title: Load values from database to create a drop down menu based on the selection from previous dropdown
body: <p>My problem is that I try to load a drop down based on selection from previous drop down. I'm loading the values from database. but when I use <code>$_get['emirate']</code> I'm not getting the value. It says the value is not set.</p>
  
  <pre><code>$data = mysql_query("SELECT * FROM emirate") 
          or die(mysql_error()); 
  
      Print "&lt;table border cellpadding=3&gt;"; 
      print"&lt;tr&gt;&lt;th&gt;&lt;form method=get action='index.php'&gt;&lt;select id=EMIRATE size=1&gt;&lt;OPTION value=all&gt;all&lt;/option&gt;";
      while($info = mysql_fetch_array( $data )) 
      { 
          Print "&lt;option value=". $info['em_name'] ."&gt;".$info['em_name']."&lt;/option&gt;"; 
      }
      print"&lt;/select&gt;&lt;/form&gt;&lt;/th&gt;";
      if(isset($_GET['EMIRATE'])){
          $name=$_GET['EMIRATE'];
          echo $name;
  
          $data = mysql_query("SELECT a_name FROM areas where em_id=(select em_id from emirate where em_name=\"".$name."\")") 
          or die(mysql_error());
          Print "&lt;th&gt;&lt;select name=AREAS size=1&gt;";
          while($info = mysql_fetch_array( $data ))
          {
              Print "&lt;option &gt;".$info['a_name']."&lt;/option&gt;";
          }
          print"&lt;/select&gt;&lt;/th&gt;";
      }
  </code></pre>