PHP sort locations by distance, returns nothing
<p>I'm testing some code to sort locations by distance from a specific point, got some code and it's returning nothing...</p>

<p>I'm entering this URL</p>

<pre><code>http://localhost:8888/jsontest.php?category=all&amp;long=-2.837275&amp;lat=51.967825 
</code></pre>

<p>to enter my variables for the lat and long as my current location, and here is the query:</p>

<pre><code>mysql_query("SELECT *,  ( 3959 * acos( cos( radians('$lat') ) *  cos( radians( lat ) ) *  cos( radians( long ) -  radians('$lon') ) +  sin( radians('$lat') ) *  sin( radians( lat ) ) ) )  AS distance FROM LISTINGS ORDER BY distance ASC");
</code></pre>

<p>Getting variables from URL:</p>

<pre><code>$lon = $_GET["long"];
$lat = $_GET["lat"];
</code></pre>

<p>Database table name is listings, lat and long columns are called lat and long, can anyone help!</p>

<p>Thanks.  </p>
