title: MySQL query selecting values from two tables
body: <p>I have the following two tables:</p>
  
  <pre><code>Cities: id | name | county_id
  Counties: id | name
  </code></pre>
  
  <p>I am passing this query a county 'name' and I am trying to select id and name of all rows from cities with the same county_id. I am having difficulty building a query across these two database tables. Here is what I have:</p>
  
  <pre><code>"SELECT cities.id,cities.name
  FROM cities,counties
  WHERE counties.name='$county' AND cities.county_id=counties.id
  ORDER BY cities.name ASC";
  </code></pre>