Selecting individual items from multi item list box

4 posts by 2 authors in: Forums > CMS Builder
Last Post: October 6, 2008   (RSS)

Re: [Mr Jim] Selecting individual items from multi item list box

For anyone who's interested, I found that there's a very easy way to do what it is I was trying to do.

Simply needed to use the LIKE command in the SQL statment that is used to populate the array.

In my case, where I'm looking for items that are for Sale, it was as simple as adding:

'where' => "display_areas LIKE '%Sale%'",

Jim
WebCamp One, LLC



Websites That Work

Re: [Mr Jim] Selecting individual items from multi item list box

By Dave - October 6, 2008

Hi Jim,

Multi value fields are stored in the database as tab separated values with a leading and trailing tab. This is so you can search for (tab)your value(tab) and always get an exact match. In mysql that's:

'where' => "display_areas LIKE '%\tSale\t%'",

You can also try url searches like this:

viewer.php?display_areas=Sale

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

Re: [Dave] Selecting individual items from multi item list box

Dave,

Thanks much. That works just fine.

Jim
WebCamp One, LLC



Websites That Work