Cities with 0 (zero)

Development discussion about the hostip.info codebase, libraries, and database

Moderator: Moderators

Cities with 0 (zero)

Postby soachs on Fri May 20, 2005 10:59 pm

The Problem: Seems many, MANY, "city" fields in the database have a 0 (zero), thus I can't get it to return a result for many of the IP's I enter, however when I enter the IP on this site it works. I believe my script is working right because it is working for some IP's (resolving to a city/state). Here's an example:

Example IP (real): 68.6.129.178

My Query: SELECT city, country FROM ip4_68 WHERE b = '6' && c = '129'

Result: city: 0 - country: 226

Next Query: SELECT name FROM cityByCountry WHERE city = '0' && country = '226'

(Obviously if "city" is 0 there is no chance I will get a result back.)

Any thoughts? :?: :?: :?:
soachs
Expert
 

Re: Cities with 0 (zero)

Postby bfolkens on Sun May 22, 2005 10:41 am

soachs wrote:The Problem: Seems many, MANY, "city" fields in the database have a 0 (zero), thus I can't get it to return a result for many of the IP's I enter, however when I enter the IP on this site it works. I believe my script is working right because it is working for some IP's (resolving to a city/state). Here's an example:

Example IP (real): 68.6.129.178

My Query: SELECT city, country FROM ip4_68 WHERE b = '6' && c = '129'

Result: city: 0 - country: 226

Next Query: SELECT name FROM cityByCountry WHERE city = '0' && country = '226'

(Obviously if "city" is 0 there is no chance I will get a result back.)

Any thoughts? :?: :?: :?:


Replied to your email about this directly - should've checked the forum first I guess ;)

In any case - there are still quite a few IPs w/out city information (this improves every day though) - but for now, do a left join if doing a query, or check for the 0 first. The country is valid, but for those with city=0 we haven't gotten down to city resolution yet.
bfolkens
Site Admin
 
Posts: 154
Joined: Tue Feb 22, 2005 8:09 am

Help plz

Postby Guest on Sun Nov 27, 2005 10:04 am

[quote="bfolkens"][/quote]

Does any one know what is wrong here?




900pay online casinos fun Online Casinos
Guest
Expert
 


Return to Hostip.info code/database devel

Who is online

Users browsing this forum: No registered users and 4 guests

cron