where clause syntax - two conditions

2 posts by 2 authors in: Forums > CMS Builder
Last Post: October 14, 2010   (RSS)

By Deborah - October 14, 2010

I have a where clause filtering condition I've not needed before. I would like to filter detail page results matching these two conditions:

1) category match ("multi-checkbox list field from another table)
AND 2) not archived (single checkbox)

I currently have the category filtering fine with:
'where' => "category = \"Artist\"",

I've not been able to add the AND condition for the archiving without receiving a syntax error. Have tried the following:
'where' => 'category = \"Artist\" AND archived !== 1',
'where' => 'category = \"Artist\" AND archived !== "1" ',
'where' => " category = \"Artist\" AND archived !== 1" ,

I'm hoping someone here can help with the syntax. Thanks in advance.
~ Deborah

Re: [Deborah] where clause syntax - two conditions

By Chris - October 14, 2010

Hi Deborah,

!== isn't a MySQL operator, you'll want to use != instead. I think that will fix your syntax error problem. If not, please post the exact error you're getting and your complete PHP source code for that page.

I hope this helps! Please let me know if you have any questions.
All the best,
Chris