I have populated a dropdown list in Dreamweaver, which loads fine, but it is passing the first item of the list, not the selected one. Not sure why? ??? In a time crunch, Thanks for any help!
<? mysql_select_db($database_connJDD, $connJDD);
$query_rsSKU = "SELECT products.SKU FROM products";
$rsSKU = mysql_query($query_rsSKU, $connJDD) or die(mysql_error());
$row_rsSKU = mysql_fetch_assoc($rsSKU);
$totalRows_rsSKU = mysql_num_rows($rsSKU);
?>
<table align="center">
<tr>
<td>
<p align="center">Select SKU for <br />
Update Product </p>
<form id="form5" name="form5" method="post" action="updateProducts.php?ProductNo=<?php echo $row_rsSKU['SKU']; ?>">
<select name="skuList">
<?php
do {
?>
<option 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> <br />
<input name="Update" type="submit" value="Update" />
</form>
</td>
</tr>
</table>
<?php
mysql_free_result($rsSKU);
?>