I'm following this guide
http://code.google.com/support/bin/answer.py?answer=87134&topic=11364 to help me create store locator functionality, but changing the code to
java. I have not actually gotten to the part that i will need to change as it took me some time to automate the geocoder funcionality in js and then pass to the db.
To
test the Haversine sql code, i just tried it in the mysql command line window but i'm not getting any results.
Here is what i'm getting.
mysql> SELECT id, ( 3959 * acos( cos( radians(40) ) * cos( radians( lat ) ) * co
s( radians( lng ) - radians(-73) ) + sin( radians(40) ) * sin( radians( lat ) )
) ) AS distance FROM venueent HAVING distance < 25 ORDER BY distance LIMIT 0,20;
Empty set (0.00 sec)
mysql> select id, lat, lng from venueent;
+----+----------+----------+
| id | lat | lng |
+----+----------+----------+
| 1 | NULL | NULL |
| 2 | NULL | NULL |
| 3 | NULL | NULL |
| 4 | NULL | NULL |
| 5 | NULL | NULL |
| 6 | NULL | NULL |
| 7 | -73.9876 | -73.9876 |
| 8 | 40.7554 | -73.9876 |
+----+----------+----------+
8 rows in set (0.00 sec)
I know my data is very incomplete, but this should return atleast 2 values. Instead i get 0.
Why?