Multi select update
I have placed the following code at line 1:
<?php
if($_SERVER["REQUEST_METHOD"] == "POST") {
foreach($_POST as $key => $val) {
if(is_array($_POST[$key])) $_POST[$key] = implode(", ", $_POST[$key]);
}
}
?>
and have the following multi select:
<select class="formListfield_Medium" name="User_Update_group_1_ExpertiseAreas[]" id="User_Update_group_1_ExpertiseAreas" tabindex="19" multiple="multiple">
<option value="">Please select your expertise areas </option>
<?php
do {
?>
<option value="<?php echo $row_rsExpertise['ExpertiseField']?>"><?php echo $row_rsExpertise['ExpertiseField']?></option>
<?php
} while ($row_rsExpertise = mysql_fetch_assoc($rsExpertise));
$rows = mysql_num_rows($rsExpertise);
if($rows > 0) {
mysql_data_seek($rsExpertise, 0);
$row_rsExpertise = mysql_fetch_assoc($rsExpertise);
}
?>
</select>
The problem I have is that lose previously stored selects when I try and update. What would I need to change so it holds previously selected multi items?
Many thanks