simple where filter problem

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

Re: [rez] simple where filter problem

By rez - November 6, 2008

Ok. Searching a different way, i have come up with this:

list($rmenuRecords, $rmenuMetaData) = getRecords(array(
'tableName' => 'rmenu',
'where' => " category = 'Mezza' ",
));

That doesn't give me any errors but I don't get any records listed either. So My problem must be something to do with the naming, or what's a field versus column etc.

Again, Mezza is selected by the client and is an option in the editor, in a drop menu. Mezza, From the Grill, Sandwiches, etc.

CMS Editor "Menu" type is multi, category filed name is category. category field type is list (drop menu). Table name is rmenu.

Thanks for any help.

Re: [rez] simple where filter problem

By Dave - November 6, 2008

Hi rez,

Try putting quotes around the word:

'where' => 'category = "Mezza"',

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

Re: [Dave] simple where filter problem

By rez - November 6, 2008

I think we were writing at the exact same time. :)

I did the quotes thing and think that was a problem, but now using that statement doesn't seem to be the right way to list the categories from the drop menu.

Please see my post above.

Re: [rez] simple where filter problem

By rez - November 6, 2008 - edited: November 6, 2008

Oh! Got it. Your quotes were still different than mine. thanks.

Re: [rez] simple where filter problem

By Dave - November 6, 2008

Also, another even simpler way to do this is with an url (remove the 'where' first):

yourViewer.php?category=Mezza

You can read more about the built in search and filtering options here:
http://www.interactivetools.com/docs/cmsbuilder/viewer_search.html
Dave Edis - Senior Developer
interactivetools.com