PHP mysql query for get near by location over lat-lng

Using Below query we can find near by locations by lat-lng. $zipcode_lat = 23.0314594; $zipcode_long = 72.5641077; SELECT *, (((acos(sin((" . $zipcode_lat . "*pi()/180)) * sin((`latitude`*pi()/180))+cos((" . $zipcode_lat . "*pi()/180)) * cos((`latitude`*pi()/180)) * cos(((" . $zipcode_long . "- `longitude`)* pi()/180))))*180/pi())*60*1.1515 ) as distance FROM " . business . " WHERE city = 'Ahmedabad' ORDER BY distance ASC LIMIT 3

Read more