Monday 21 July 2014

PHP : select values from table and show in drop down menu on front end

<table>
<tr><td>Select Category</td>
<td><select name="select1" onChange="onChange()">
    <option value="">Select Category</option>
<?php
 $reza=mysql_query("select qcid,qcname from qcategory order by qcid");
                    while ($row=mysql_fetch_array($reza)){
  $id1=$row["qcid"];
                      $id2=$row["qcname"];
                     
echo "<option value=\"$id2\">$id2</option>";
                    }
mysql_close($con);
?>
</select></td></tr>
</table>

No comments:

Post a Comment