Mysqli dynamic drop down menus
We have the dynamic drop down menus working perfectly populating from a record set multiple options stored in a database. We want to have the drop down select menu show the value that as inserted. I've read all threads concerning this, with no success. We tried to bind the values through DW but we get an errro message that says that is already binded. This is the code:
<select name="state" required id="state">
<option value="-1">--Select--</option>
<?php
while(!$rsStates->atEnd()) {
?>
<option value="<?php echo($rsStates->getColumnVal("states_abr")); ?>">
<?php echo($rsStates->getColumnVal("states_desc")); ?></option>
<?php
$rsStates->moveNext();
}
?>
</select>
This is the code as Webassist threads:
<select name="postal_state" required id="postal_state">
<option value="-1" <?php if (!(strcmp(-1, ($rsPostal->getColumnVal("state_abrv"))))) {echo "selected=\"selected\"";} ?>>--Select--</option>
<?php
while(!$rsStatesPostal->atEnd()) {
?>
<option value="<?php echo($rsStatesPostal->getColumnVal("states_abr")); ?>">
<?php echo($rsStatesPostal->getColumnVal("states_desc")); ?></option>
<?php
$rsStatesPostal->moveNext();
}
?>
</select>
How do we bind it?
Please help!!