i have to find distance between two points (lat and long)
SELECT *,(3959 * ACOS( COS(RADIANS(".$latitude.")) * COS(RADIANS(latitude)) * COS(RADIANS(longitude) - RADIANS(".$longitude.")) + SIN(RADIANS(".$latitude.")) * SIN(RADIANS(latitude)))) as distance FROM tbl_places tp
LEFT JOIN tbl_categories tc
ON tp.category_id = tc.category_id
WHERE tc.category_name = 'food'
ORDER BY distance ASC