mysql field not resolving comaparison condition for zip code locator

From: Date: Tue, 23 Sep 2003 18:40:13 +0000
Subject: mysql field not resolving comaparison condition for zip code locator
Groups: php.db 
Request: Send a blank email to php-db+get-30646@lists.php.net to get a copy of this message
I am having trouble implementing a zip code locator program. All of the functions work correctly but the $sql variable. The problem occurs by using the latitude argument as a comparison. The first latitude argument works but when the second latitude argument is added the query returns no data. Here is an example of the $sql variable being used. $sql=SELECT City FROM ZIPCodes WHERE Latitude <= 122.02671343318 AND Latitude >= 121.96888656682 AND Longitude >= 37.617091284671 AND Longitude <= 37.508048715329; This is the format recommended by the zip code locator develper for the sql argument. There must be some logical way to present this to the mysql database that will perform the latitude and longitude comparison and retun the proper results. A suggestion was making sure that the field is a numberic string type. I used "Float", "Decmial", "Double" and "CHAR" the result was the same. Please help!

« previous php.db (#30646) next »