title: How to populate a combo-box in EDIT FORM
body: <p>please help me. I include here (see bellow) the Combobox script for INSERTING FORM
  I have a Form of Adding a new product. One of option is to select what Category. So, Combobox is for selecting Category from.</p>
  
  <pre><code>&lt;TD&gt;
  
  &lt;?php
  
  $sql="SELECT categories.id as id, categories.name as name FROM categories";
  $result=mysql_query($sql) or die(mysql_error());
  
  $options="";
  
  while ($row=mysql_fetch_assoc($result)) {
  $id=$row["id"];
  $thing=$row["name"];
  $options.= " &lt;OPTION VALUE=".$id."&gt;".$thing.'&lt;/option&gt;';
      }
  
  ?&gt;
  
  &lt;select name="CATEGORY" onClick=”submitCATEGORY();”&gt;
   &lt;option value="0"&gt;Select Category
   &lt;?php echo $options;?&gt;&lt;/option&gt;
  
  &lt;/select&gt;   
  &lt;/TD&gt;
  </code></pre>
  
  <p>Now, I would like to have an EDIT FORM using the same script as for Inserting data in database using combobox.</p>
  
  <p><code>&lt;?php echo $CATEGORY; ?&gt;</code> this script is for retrieving the data from database.</p>
  
  <p>please help me to find a way, when I want to Edit a PRODUCT information to get combobox with option I selected during the inserting the data...
  I could succeed to fill the data for the name of products and other information, only Combobox is empty. I hope you could understand what I want to achieve! Thank you in advance for your time!!!</p>
  
  <p>See bellow what I tried but did not succede:</p>
  
  <pre><code>&lt;?php
  $sql="SELECT categories.id as id, categories.name as name FROM categories";
  $result=mysql_query($sql) or die(mysql_error());
  
  $options="";
  while ($row=mysql_fetch_assoc($result)) {
  $id=$row["id"];
  $thing=$row["name"];
  $options.= " &lt;OPTION VALUE=".$id."&gt;".$thing.'&lt;/option&gt;';
          }
      ?&gt;
      &lt;select name="CATEGORY" onClick=”submitCATEGORY();”&gt;
  &lt;option value="&lt;?php echo $CATEGORY; ?&gt;"&gt;
  &lt;?php echo $options;?&gt;&lt;/option&gt;
  &lt;/select&gt;
  &lt;/TD&gt;
  </code></pre>