Holding Values for a Multiple List on an Update form
Hi Eric,
Apologies I cannot get this to work as am unsure how to do this - the error message I get with the multiple select form is :
Warning in_array [function.in-array]: Wrong datatype for second argument on line 234 >Assembly and Leisure
When an option or options from the list - the results page returns a value of Array. Then if the update form is accessed again, and the multiple select list is not changed by the user. The word Array disappears from the results page (i.e. and from the database)
I know it is to do with where I have put the code you kindly provided but am stuck.
This is the list option:
<select name="PropertyType[]" size="6" multiple="multiple" id="PropertyType[]" title="<?php echo $row_WADAproperties['PropertyType']; ?>">
<?php
do {
?><option value="<?php echo $row_rspropertytypes['PropertyType']?>"<?php if (!(in_array($row_rspropertytypes['PropertyType'], $row_WADAproperties['PropertyType']))) {"selected='selected'";} ?>><?php echo $row_rspropertytypes['PropertyType']?></option>
<?php
} while ($row_rspropertytypes = mysql_fetch_assoc($rspropertytypes));
$rows = mysql_num_rows($rspropertytypes);
if($rows > 0) {
mysql_data_seek($rspropertytypes, 0);
$row_rspropertytypes = mysql_fetch_assoc($rspropertytypes);
}
?>
</select>
And this is the explode code is on the last line of the following:
$WA_table = "properties";
$WA_redirectURL = "properties_Results.php";
$WA_keepQueryString = false;
$WA_indexField = "MainPropertiesID";
$WA_fieldNamesStr = "SLNNumberID|FirstName|LastName|Company|PropertyType|Assembly|HealthCare|Office|SaleORLease|RegionName|Address1|Address2|Address3|City|County|PostCode|Country|ThumbPath|Thumb|PicturePath|Picture|AgentLogo|PropertyDetails|Size|Sep|SizeMax|SizeType|shortDescription|longdescription|CURR|PriceDetails|RentalPeriod|Price|Status";
$WA_fieldValuesStr = "".((isset($_POST["SLNNumberID"]))?$_POST["SLNNumberID"]:"") ."" . "|" . "".$row_WADAproperties['FirstName'] ."" . "|" . "".$row_WADAproperties['LastName'] ."" . "|" . "".$row_WADAproperties['Company'] ."" . "|" . "".((isset($_POST["PropertyType"]))?explode(", ", $_POST["PropertyType"]):"")
Please Help! X