I have the code below being used to rifle through a list of available
categories and create select options for them. The code is being used to
query the database and compare the product category to the current
iteration, if there's a match, then add selected code so the category is
prechosen. More code (not included) does the saving and all that, I've check
phpmyadmin. But when the page submits, the old category appears in the drop
down as selected. If I leave the page and come back it's fine, it's just
right after it is saved. The form script is being used on itself, in that
there is only one file for the form, the submission, etc. All of the other
input elements will load the data after being saved, is it something
specific to dropdowns, or it is the way the code is being instatiated?

All help is much appreciated. Please let me know if anymore info is needed.

$sql="SELECT * FROM categories ORDER BY category";

$catmatch="SELECT * FROM product WHERE dbi='$dbi'";
//echo $catquery['prod_cat0'];

while ($col2=mysql_fetch_array($result)) {
    $catlist1.="<option value=\"$id\"
    else {
    $catlist1.="<option value=\"$id\">".$id."</option>";


to instantiate <?=$catlist1?>

Reply via email to