title: Show nearest locations from database to user's GeoLocation
body: <p>I am using Google Maps API v3 to show all stored locations from the database as a marker. 
  What I am trying to do is show a list beneath the map with the closest locations(let's say within 10km) and their name, description &amp; distance to user's current location, ordered by distance. I can't figure out how to build the query. I currently have this code which shows all places in the database:</p>
  
  <pre><code>$q = "SELECT name, image, description, price, lat, lng, rating, owner FROM places"; 
          $res1 = mysqli_query($linkNew, $q);
  
              while($row1 = mysqli_fetch_array($res1)){
                  echo "&lt;div class='place'&gt;";
                  echo "&lt;h3 class='placeTitle'&gt;" . $row1[0] . "&lt;/h2&gt;&lt;br /&gt;";
                  echo "&lt;img src='" . $row1[1] . "' class='placeImage' width='30' height='30' /&gt;";    
                  echo "&lt;p class='placeDescription'&gt;" .$row1[2] . "&lt;/p&gt;&lt;br /&gt;";
                  echo "&lt;p class='placePrice'&gt;€ " .$row1[3] . "/night&lt;/p&gt;&lt;br /&gt;";
                  echo "&lt;p class='placeRating'&gt;" .$row1[6] . "/5&lt;/p&gt;&lt;br /&gt;";
                  echo "&lt;p class='placeOwner'&gt;Owner: &lt;a href='#'&gt;&lt;b&gt;" .$row1[7] . "&lt;/b&gt;&lt;/a&gt;&lt;/p&gt;&lt;br /&gt;";
                  echo "&lt;/div&gt;";
              }       
  </code></pre>