title: php drop down print selected item
body: <p>I am trying to print the selected dropdwon item. I have already written the code for dropdown to fetch a column from database. </p>
  
  <p>Now i should print the only the id of selcted dropdown item. i don't know how to make it. please help me, this is my code</p>
  
  <pre><code>&lt;? 
  $query_name="SELECT id_cat,name FROM `fs01_metier_cat` ORDER BY `fs01_metier_cat`.`name` ASC";
  $result = mysql_query ($query_name);
  
  echo "&lt;select name=category value=''&gt;&lt;/option&gt;";
  while($nt=mysql_fetch_array($result))
  {
      echo "&lt;option value=$nt[name]&gt;$nt[name]&lt;/option&gt;";
  }
  echo "&lt;/select&gt;";
  
  
  
  $query_id="SELECT id_cat FROM `fs01_metier_cat`";
  $result1 = mysql_query ($query_id);
  while($row = mysql_fetch_assoc($result1))
  {
     echo $row['id_cat'];
  }
  
  ?&gt;
  </code></pre>