title: Save value from the drop down menu into database (php, mysql)
body: <p>I have a drop down menu that shows categories from the database (table <code>category</code>, with two columns: <code>category_id</code> and <code>category_name</code>). The second table is <code>photo</code>s and it has a foreign key <code>category_id</code>.</p>
  
  <p>Code that shows drop-down menu from the database:</p>
  
  <pre><code>$sql = "SELECT category_id, category_name FROM category";
  
  $result = mysql_query($sql);
  
  echo "&lt;select name='category_name'&gt;";
  while ($row = mysql_fetch_array($result)) {
  echo "&lt;option value='" . $row['category_name'] . "'&gt;" . $row['category_name'] . "&lt;/option&gt;"; }
  
  echo "&lt;/select&gt;";
  </code></pre>
  
  <p>Now I don't know how to save the chosen option of category in the database. Any help appreciated ...</p>