close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Multi select update

Thread began 3/18/2013 4:26 am by chris250441 | Last modified 3/18/2013 8:44 am by chris250441 | 850 views | 4 replies |

chris250441

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

Sign in to reply to this post

Jason ByrnesWebAssist

I think the real problem is the database design.

You shouldn't be storing a comma separated list of values in a column of your table. this is a bad database design.

instead you should be using a linking table and use the Data Assist Manage relational table behavior.

There is a tutorial for this on the data bridge support page:
data-bridge/

Sign in to reply to this post

chris250441

Thanks Jason, I am stuck with what I have got so can you help me or not?

Sign in to reply to this post

Jason ByrnesWebAssist

It requires hand coding to accomplish.

see this post:
showpost.php?p=121667&postcount=2

Sign in to reply to this post

chris250441

Halleluiah!!! it's like squeezing blood out of a stone. Thanks Jason.

Sign in to reply to this post

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