close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

When a 'list' item, how to get beyond 'array' in Search Results page?

Thread began 3/28/2014 7:49 pm by david_allen | Last modified 3/31/2014 3:52 pm by david_allen | 202 views | 2 replies |

david_allen

When a 'list' item, how to get beyond 'array' in Search Results page?

All my lookup tables, bar one, are 'menus.' When searching in the database, these items show up in the results with the entry for each record. So satisfying.

However, one of my lookup tables necessarily must be a 'list' - multiple values are possible. The menu works nicely in Insert / Update. However, the output for that menu item on the Results page is always 'array.'

May I learn, in my newbinesss, how to deal with this? Is there a way to see multiple results, for instance, or just one if there is only one in that particular record. Or perhaps, some sort of actual array in the results page, indicating what has been selected and what not?

Then of course, there is the question of how to use the outcome, in a binding on a page …

Probably too late tonight, so maybe let's do this Monday.

Thanks, David

Sign in to reply to this post

Jason ByrnesWebAssist

when using a multiple select list, or multiple checkboxes, the selections will be transmitted as an array.

you can convert the array to a comma seperated listed using the implode function:

add this 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]);
}
}
?>



then you can write the comma separated list to the page using:

<?php echo((isset($_POST["ElementName"]))?$_POST["ElementName"]:"") ?>



where ElementName is the name of the select list.

Sign in to reply to this post

david_allen

Jason, thanks so much.

Since, on reflection, it seems we are better off with multiple checkboxes, this most directly addresses the question.

I am grateful, thanks.

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