where AND / OR

6 posts by 3 authors in: Forums > CMS Builder
Last Post: April 28, 2011   (RSS)

By Toledoh - April 27, 2011

Hi Guys.

I've got a bunch of "speakers" in a table, that need to be grouped in various ways.

Firstyly, by type... so that's easy;
'where' => 'type="Keynote"',

But then I add a mulit-select as well...

How can I say;
// load records
list($speakersRecords, $speakersMetaData) = getRecords(array(
'tableName' => 'speakers',
'where' => 'type="Keynote"',
'AND WHERE' => 'category LIKE 1'
));

Cheers,

Tim (toledoh.com.au)

Re: [Toledoh] where AND / OR

By zip222 - April 27, 2011

This should do it...

// load records
list($speakersRecords, $speakersMetaData) = getRecords(array(
'tableName' => 'speakers',
'where' => 'type="Keynote" AND category LIKE 1'
));

Re: [zip222] where AND / OR

By Toledoh - April 27, 2011

It doesn't seem to like category LIKE 1'

However I've just used 'where' => 'type="Keynote" AND category = 1' and it works for now as all the speakers have only only 1 category slected.

Any ideas on how to get LIKE to work?
Cheers,

Tim (toledoh.com.au)

Re: [Dave] where AND / OR

By Toledoh - April 27, 2011

Perfect - thanks Dave!
Cheers,

Tim (toledoh.com.au)

Re: [Dave] where AND / OR

By zip222 - April 28, 2011

Nice overview. Bookmarked for future reference. Thanks Dave!