I am returning a result set from a mySQL database into a table using 5 columns. So far so good the table is displaying the correct field data. I would like to know how I should go about creating a drop down menu for each row? This will be the 6th column named ‘Status’ and will consist of three values which will change the appearance of a row. Another thing to mention is that the ‘Status’ will not be linked to the database. Here is my current code:
<?php
$result = mysql_query("SELECT * FROM somewhere")
or die (mysql_error());
?>
<table class="table1" >
<h4>Orders</h4>
<tr>
<th>Number</th>
<th>Date</th>
<th>Ordered By</th>
<th>Supplier</th>
<th>Price</th>
<th>Status</th>
</tr>
<?php
while($row=mysql_fetch_array($result)){
echo "</td><td>";
echo $row['Orderno'];
echo "</td><td>";
echo $row['Orderdate'];
echo "</td><td>";
echo $row['Orderedby'];
echo "</td><td>";
echo $row['Supplier'];
echo "</td><td>";
echo $row['totalprice'];
echo "</td><td>";
echo $row['Status'];
echo "</td></tr>";
}
echo "</table>";
?>
This is only sample. You can use according to your requirements