Outputting from a multi select list

5 posts by 2 authors in: Forums > CMS Builder
Last Post: September 17, 2008   (RSS)

Re: [Liz1001] Outputting from a multi select list

By Dave - September 10, 2008

Hi Liz,

There's currently no way to do "OR" searches without writing some custom code. So multi select searches aren't supported yet. You can combine the searches like this though:

'where' => ' category = "lodging" AND sub_category = "cottages" ',

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Outputting from a multi select list

Hi Dave;

Thank you for the help, that only seems to work if the sub_category is a single select radio button, can we have the same results if we use the checkbox (multi value) option. Some of the members want to check more than one option. It sounds like it is probably not an option from your answer but thought I would just clarify.

Thank you
Liz

Re: [Liz1001] Outputting from a multi select list

By Dave - September 10, 2008

"Or" searching isn't automatically supported, no.

But can you post (or email me - dave@interactivetools.com) a link to your search form. I'll see if I can think of any simple solutions.

Hope that helps!
Dave Edis - Senior Developer
interactivetools.com

Re: [Dave] Outputting from a multi select list

Dave, thank you for the solution this worked well:

"Multi value checkboxes store their values in the database as a list separated by tabs. Try this MySQL to match a single value from the list of selected values:

'where' => 'category LIKE "%cottages%" ',

LIKE means "looks like" and % means "anything". So this matches text that starts with anything, then has cottages, then ends with anything."

Liz