how to calculate distance between two latitude and longitude in mysql?
SELECT getDistance(lat1,lng1,$lat2,$lng2) as distance FROM your_table. Here's a MySQL function that will take two latitude/longitude pairs, and give you the distance in degrees between the two points. It uses the Haversine formula to calculate the distance.