1 2 3 4 5 6 |
SELECT *, ( 6371 * acos( cos( radians({$lat}) ) * cos( radians( `lat` ) ) * cos( radians( `lng` ) - radians({$lng}) ) + sin( radians({$lat}) ) * sin( radians( `lat` ) ) ) ) AS distance FROM `positions` HAVING distance <= {$radius} ORDER BY distance ASC |
Leave a reply