View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

PHP MYSQL Form - Multiple Select List

Thread began 12/30/2009 2:51 pm by karen.marley367377 | Last modified 5/03/2011 4:03 pm by karen.marley367377 | 15609 views | 29 replies

karen.marley367377

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

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...