Hi
Im sorry, I found it a bit tricky to understand your problem, but if what you are saying is that you want a drop down list to be taken from a database, and the item to automatically be selected if the user is updating the data, then this is what I use. If this is not the problem then please let me know.
<form method="post" action="add.php" name="add_product">
<select name="product">
<? create_options($product) ?>
</select>
</form>
#
create the drop down list of products
#
function create_options($product)
{
if ($product == "") {
echo "<option value='0' selected>- select -</option> \n";
}
custom_connect(); # connect to the database
$qry_str = "select productID, productName form ProductTable";
$qry = mysql_query($qry_str);
while ($row = mysql_fetch_array($qry))
{
echo "<option value='". $row["productID"]. "'";
if ($row["productID"] == $product) {
echo " selected ";
}
echo ">". $row["productName"]. "</option> \n";
}
}