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 | 15621 views | 29 replies

Eric Mittman

Thanks for the files, it clears things up a bit. On your insert page you are using the implode correctly to create a string of the selections that the user has made. On the update page you are not using the explode correctly for this information.

Just after the code for your properties recordset you will need to add in some custom code to store the exploded array into a variable, it might look like this:

php:
$the_properties = explode(", ", $row_WADAproperties['PropertyType']);



This will give you an array of the selections that were made by the user. With this new array you can use the in_array comparison in your select list on the page. You will need to update the check you are doing with the current in_array for the options. The options in the select list should look like this:

php:
<option value="<?php echo $row_rspropertytypes['PropertyType']?>"<?php if (in_array($row_rspropertytypes['PropertyType'], $the_properties)) { print("selected='selected'");} ?>><?php echo $row_rspropertytypes['PropertyType']?></option>



This should ensure that the values that were selected on the insert page are shown on the update page by default. There is one more thing you will need to change, since the select list will return an array of values you need to implode the array in your insert server behavior. Currently you are exploding this value, if you change this to the implode it should work. Please give this a try and let us know what the result is for you.

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...