Order table by proximity to specific latitude/longitude (using MySQL+PHP)

VullyinaraBal

New Member
MySQL (table)\[code\]id | url | lat | lng----------------------------------1 | x | 44.339565 | -101.337891----------------------------------2 | y | 44.150681 | -101.074219----------------------------------3 | z | 43.897892 | -100.634766\[/code\]what I want to do now is order the list according to their proximity to (43.834527,-99.140625).\[code\]$a = mysql_query("SELECT * FROM table ORDER BY proximity DESC");while($b = mysql_fetch_assoc($a)){echo $b['url'].'<br />';}\[/code\]
 
Back
Top