I have a selection box with a list of SALES people in, that is pulled from a Database table and i later store the SALES_ID in the ORDER table:
This is fine, however - I use the selection box in an ORDER table where I store the SALES_ID to associate a SALES_PERSON with an Order.
What I can't figure out is how I would EDIT the Order and have the SALES_PERSON selected as default from the selection box!
Code:
$query = "SELECT * FROM sales ORDER BY sales_person ASC";
$result = mysql_query($query) or die (mysql_error());
echo "<select name='sales_id' id='$sales_id'>";
while ($row = mysql_fetch_row($result)){
$sales_id = $row[0];
$sales_person = $row[1];
$sales_office = $row[2];
print("<option value=\"$sales_id\">$sales_person, $sales_office</option>\n");
}
This is fine, however - I use the selection box in an ORDER table where I store the SALES_ID to associate a SALES_PERSON with an Order.
What I can't figure out is how I would EDIT the Order and have the SALES_PERSON selected as default from the selection box!