Current value for Multiple Select Menu
I changed a Menu to multiple select (and yes, added [] to the select value). My problem is, in Update, it's not pulling in existing selection(s). Here's the code:
<select name="category[]" size="5" multiple="multiple" id="category">
<?php
do {
?>
<option value="<?php echo $row_WADADynListcompanies_type['name']?>"<?php if (!(strcmp($row_WADADynListcompanies_type['name'], $row_WADAcompanies["category"]))) {echo "selected=\"selected\"";} ?>><?php echo $row_WADADynListcompanies_type['display']?></option>
<?php
} while ($row_WADADynListcompanies_type = mysql_fetch_assoc($WADADynListcompanies_type));
$rows = mysql_num_rows($WADADynListcompanies_type);
if($rows > 0) {
mysql_data_seek($WADADynListcompanies_type, 0);
$row_WADADynListcompanies_type = mysql_fetch_assoc($WADADynListcompanies_type);
}
?>
</select>
- What am I missing here?
THANKS
===> ADDITIONAL INFORMATION
I see that DataAssist isn't storing the data properly in the db when I INSERT a new record (and I'm sure when I UPDATE). It's putting the word "Array" in the db instead of the array itself. What to do? What to do...?
===> FURTHER UPDATE
I can easily change the Update page to insert the correct information into the db field using IMPLODE. In the Application Builder section I changed $_POST["category"] to implode(",",$_POST["category"]) and it inserts a comma separated list into the db field as I want. Now the problem is....how do I get the Update page to display those as selected in a multiple select field?