title: find closest location with lat and long based on db data
body: <p>I want to find nearest location based on requested lat and lon from my database data.
  I am confused my code result that it's distance is right or wrong?</p>
  
  <pre><code>$lat= mysql_real_escape_string($_REQUEST['lat']);
  
  $lng= mysql_real_escape_string($_REQUEST['lon']);
  $multiplier = 112.12; 
  $distance = 20;   
  
  $sql=" SELECT beach.id,county.title,municipality.title,beach.beach_name,beach.description,beach.latitude,beach.longitude,beach.rainfall,beach.temperature,beach.status_id,beach.status_details,beach.notice, (SQRT(POW((beach.latitude - $lat), 2) + POW((beach.longitude - $lng), 2)) * $multiplier) AS distance 
  from beach as beach,county as county,municipality as municipality where beach.county_id=county.id and beach.municipality_id=municipality.id  and POW((beach.latitude - $lat), 2) + POW((beach.longitude - $lng), 2) &lt; POW(($distance / $multiplier), 2) ORDER BY distance ASC LIMIT 0 , 3";
  </code></pre>