Update Multiple Select prefill existing values
Hello,
I have a multiple select that is currently reading from a Recordset to populate dynamically.
This is working great, however on the update screen I am losing the values for this select because they are not pre-populating from the record? How do I continue to dynamically read in a recordset as options but also pre-fill data on the form so I don't lose it upon update?
<select name="icons[]" multiple id="icons">
<?php
do {
?>
<option value="<?php echo $row_icons['id']?>"<?php if (!(strcmp($row_icons['id'], $row_WADAgbl_qemplisting['icons']))) {echo "selected=\"selected\"";} ?>><?php echo $row_icons['name']?></option>
<?php
} while ($row_icons = mysql_fetch_assoc($icons));
$rows = mysql_num_rows($icons);
if($rows > 0) {
mysql_data_seek($icons, 0);
$row_icons = mysql_fetch_assoc($icons);
}
?>
</select>