Hi
I am trying to generate a dynamic select box and then to update the database with the value selected if it has been altered.
This is what I currently have:
I don't think I have worked out how to pass the new SALES_ID from the select box.
Any help, would be appreciated! Many thanks
I am trying to generate a dynamic select box and then to update the database with the value selected if it has been altered.
This is what I currently have:
Code:
$cust_id = $_GET['cust_id'];
$rainbow_order_id = $_GET['rainbow_order_id'];
$update = $_GET['update'];
$acc_order_id = $_GET['acc_order_id'];
$sales_id = $_GET['sales_id'];
include("conn.php");
$query = "SELECT * FROM sales ORDER BY sales_person ASC";
$result = mysql_query($query) or die (mysql_error());
include("Header.htm");
echo "<img src=./images/editSalesperson.gif>";
?>
<?
echo "<form method='POST' action='updateordersalesperson.php?cust_id=$cust_id&sales_id=$sales_id&update=1&acc_order_id=$acc_order_id'>";
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");
}
?>
</select><input type="submit" value="Submit">
</form>
I don't think I have worked out how to pass the new SALES_ID from the select box.
Any help, would be appreciated! Many thanks