title: Proximity Search
body: <p>How does an application perform a proximity search? For example, a user types in a postal code, then the application lists all the businesses within 20 miles ordered by proximity.</p>
  
  <p>I want to build something like that in PHP and MySQL. Is this approach correct?</p>
  
  <ol>
  <li>Get the addresses for locations I'm interested in and store in my database</li>
  <li>Geocode all the addresses with Google's geocoding service</li>
  <li>Write a database query that includes Haversine formula to do the proximity search and ordering </li>
  </ol>
  
  <p>Is this OK? In step 3, I'm going to calculate the proximity for every query. Is it better to have a PROXIMITY table that lists the distance between every business and a few reference locations?</p>