RE: [PHP-DB] mysql field not resolving comaparison condition for zip code locator
| From: | Jennifer Goodie | Date: | Tue, 23 Sep 2003 19:21:43 +0000 |
| Subject: | RE: [PHP-DB] mysql field not resolving comaparison condition for zip code locator | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-30649@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;
>
I think Latitude only goes to 90, so they are all under 122 and none are
above 121. Also, you aren't going to get something that is greater than
37.6 but less than 37.5