Insert data selected from drop down list into mySQL table
| From: | George Lioumis | Date: | Wed, 09 Jan 2002 09:30:42 +0000 |
| Subject: | Insert data selected from drop down list into mySQL table | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-15552@lists.php.net to get a copy of this message | ||
Hello everyone!
In my mySQL DB I have the tables:
| po_product | and | products |
|----------------------| | ---------------------|
| po_id | | product_id |
| product_id | | product_name |
|----------------------| |----------------------|
With the folowing code I build a dropdown list whith the product names....
$get_list = "select product_name from products";
$res = mysql_query($get_list) or die (mysql_error());
while ($row = mysql_fetch_array($res))
{
$option_block .= "<OPTION value=\"$prd\">$prd</OPTION>";
}
I want to store into another table in my DB the product_id that corresponds to the product_name that
the user has selected....
Any help greatly appreciated.
George