title: Best way to store and retrieve user location information
body: <p>I'm currently building a professional network and although I have manage to get the overall DB structure and data entry figured out, I continue to struggle with how I should build my location table or tables and then how best to query that data to display on a users profile or to be searched upon.</p>
  
  <p>Currently I have a single locations table and that is as far as I have got.</p>
  
  <p>I'm looking for advice on how best to proceed before I invest too much time building something that may prove difficult to manage down the line or which will not work.</p>
  
  <p><strong><em>UPDATE:</strong> to clarify the location data I wish to store and in what format; A user can set a city and country of residence but can specify other cities and countries where they can work. So, in short a user has a primary location and then possibly several locations they can be.</em></p>
  
  <p><em>Currently I am only looking to store specific City, County and Country information. I do not want it to be possible for a user to specify their own location by free-typing. It would be beneficial if I could use the table to populate data entry fields too.</em></p>
  
  <p><em>However in time I would like to work on developing 'nearby' searching which will require geo location and the story of coordinates.</em></p>
  
  <p>The project is built in PHP with a MySQL database.</p>
  
  <p>The site works like this;</p>
  
  <ul>
  <li>Users register and create a profile.</li>
  <li>Their profile lists info about them, including their location.</li>
  <li>Other users can search based on select fields including another
  user's location.</li>
  </ul>
  
  <p>The database is currently set up as follows;</p>
  
  <ul>
  <li>User data sits in a users table.</li>
  <li>Profile data sits in a profiles table.</li>
  <li>Profile photos sits in a profile_photos table.</li>
  <li>Gallery Photos sits in a photos table.</li>
  <li>Location data sits ???</li>
  </ul>
  
  <p>Any help here would be appreciated.</p>