php - Get nearest locations using latitude and longitude -
i have table hotspots
id name date 1 foo 2011-06-15 15:10:34 2 bar 2011-07-02 16:45:18
and table locations
hotspotid zipcode latitude longitude 1 90001 xxxxx xxxxx 2 45802 xxxxx xxxxx
how can list hotspots nearby specific latitude , longitude miles limit using sql query?
p.s. i'd pure sql solution php ok if it's needed.
thanks
first need geographic location each hotspot ideally using latitude , longitude. can use google geocoding api go through each record , store lat/long.
then can match nearby hotspots sql query , order distance.
hope helps.
Comments
Post a Comment