I am trying to query the database for all orders, for a given designer, populate these orders in drop down, and then let the designer select one of the values in the drop down to add a tracking number.
The part that I cannot get to work is when the form is submitted, it always passes the last value that was populated in the select box, regardless of what is actually selected...
Any ideas would be greatly appreciated. Thanks.
Mark
Code:
<?php printf("<form method=GET action=http://www.website.com/designers/db_insert.php>");
//determine designers orders by looking for their id
// execute SQL query and get result
$sql_result = mysql_query("SELECT * FROM orders where designer_id = '$d_id'", $db);
// put data into drop-down list box
while ($row = mysql_fetch_array($sql_result)) {
$order_id = $row["order_id"];
$option_block .= "<OPTION value=\"$order_id\">$order_id</OPTION>";
};
?>
<b><font face=Verdana, Arial, Helvetica, sans-serif size=3>Order Number:</b></font>
</td>
<td align=left valign=middle>
<SELECT name="orders">
<?php echo "$option_block"; ?>
</SELECT><BR>