An question on latitude and longitude...Probably a silly one.
I have a set of latitude and longitudes for various locations.And, I have the latitude and longitude of the
You can use this SQL. it will select then nearest Lat, Lng from your DB entries.
SELECT id,lat,lng, ((ACOS(SIN(your_lat * PI() / 180) * SIN(lat * PI() / 180) + COS(your_lat * PI() / 180) * COS(lat * PI() / 180) * COS((your_long - lng) * PI() / 180)) * 180 / PI()) * 60 * 1.1515) AS
distance
FROMyour_table_name
HAVINGdistance
<='10' ORDER BYdistance
ASC LIMIT 0,10
Hope this will help.