title: Select option menu read from database and use it's values
body: <pre><code>&lt;?php
  mysql_connect("localhost", "root","") or die(mysql_error());
  mysql_select_db("tnews2") or die(mysql_error());
  
  $query = "SELECT name,id FROM categories ORDER BY ID DESC LIMIT  0,6";
  $result = mysql_query($query) or die(mysql_error()."[".$query."]");?&gt;
  
      &lt;select name="categories"&gt;
  &lt;?php while ($row = mysql_fetch_array($result)){
  ?&gt;
     &lt;option value=" &lt;?php $row['path']; ?&gt; "&gt;
       &lt;?php echo $row['name']; ?&gt;
      &lt;/option&gt;
  &lt;?php
  }
  ?&gt;        
  &lt;/select&gt;?&gt;
  </code></pre>
  
  <p>So this is select option menu and it's value I read from database, but when I try to Get the selected value i get only the first one.</p>
  
  <pre><code>&lt;?php
  mysql_connect("localhost", "root","") or die(mysql_error());
  mysql_select_db("tnews2") or die(mysql_error());
  
  
     if(!empty($_POST['title']) &amp;&amp; !empty($_POST['date']) &amp;&amp; !empty($_POST['txt']) &amp;&amp; !empty($_POST['image'])){
  $TITLE=$_POST['title'];
  $DATE=$_POST['date'];
  $TXT=$_POST['txt'];
  $IMAGE=$_POST['image'];
  $CATEGORIES=$_POST['categories'];
  echo $CATEGORIES;
  $ANSWER=$_POST['main'];
  $MAINPAGE=0;
  </code></pre>
  
  <p>Could you help me with an idea to get the selected option</p>