title: Dropdown Menu Values from Database and Update List onChange
body: <p>I have 2 dropdown menu  . Provinces and Cities. All values from the list comes from database, I don't have problem listing the values in the Provinces because I can query all of them and display like so:</p>
  
  <pre><code>mysql_connect("localhost", "root","") or die(mysql_error());
  mysql_select_db("occ") or die(mysql_error());
  
  $query = "SELECT id, province FROM provinces ORDER BY id ASC ";
  $result_province = mysql_query($query) or die(mysql_error()."[".$query."]");
  </code></pre>
  
  <p>and display it:</p>
  
  <pre><code>echo "&lt;option value = ''&gt;Choose One&lt;/option&gt;"; 
  while ($row = mysql_fetch_array($result_province))
  {
    echo "&lt;option value=".$row['id']."&gt;".$row['province']."&lt;/option&gt;";
  }
  </code></pre>
  
  <p>My problem is that how can I display Cities? Becase there is a relationship.
  My table structure is:</p>
  
  <pre><code>provinces
    -&gt;id
    -&gt;provinces
  </code></pre>
  
  <p>and I have</p>
  
  <pre><code>cities
  -&gt;id
  -&gt;city
  -&gt;provice_id
  </code></pre>
  
  <p>A province my have many cities/town . How can I make it that there's an onChange function on provinces and when I select a province, only those cities will appear in the cities dropdown that belongs to that provice throuh province_id.</p>
  
  <p>Sorry I'm new. Thanks!</p>