MaxBodine Posted December 5, 2007 Share Posted December 5, 2007 I have a drop down list that is populated from the database, which works, but I am passing the first item on the list, not the one selected. Not sure what I am doing wrong. I think it is in the action line, but not sure? Appreciate your help! <form id="updateProduct" name="updateProduct" method="post" action="updateProducts.php?ProductNo=<? echo $row_rsSKU['SKU']; ?>"> <div align="center"> <p>Product SKU <select name="selectSKU"> <?php do { ?> <option selected="selected" value="<?php echo $row_rsSKU['SKU']?>"<?php if (!(strcmp($row_rsSKU['SKU'], $row_rsSKU['SKU']))) {echo "selected=\"selected\"";} ?>><?php echo $row_rsSKU['SKU']?></option> <?php } while ($row_rsSKU = mysql_fetch_assoc($rsSKU)); $rows = mysql_num_rows($rsSKU); if($rows > 0) { mysql_data_seek($rsSKU, 0); $row_rsSKU = mysql_fetch_assoc($rsSKU); } ?> </select> </p> <input type="submit" value="Edit this Product" /> </div> </form> Quote Link to comment Share on other sites More sharing options...
zq29 Posted December 7, 2007 Share Posted December 7, 2007 How are you fetching the data in updateProducts.php? Also, you are marking all of your select options as selected... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.