Cake defaults to AND but you can specify any hierarchy of AND and OR
or AND or OR... until you get dizzy in the head :)
Your search could probably be formatted like:
'conditions' => array(
'Model.is_active' => 'Y',
'or' => array(
'Model.column1 LIKE' => '%keyword%',
'Model.column2 LIKE' => '%keyword',
...
...
)
On Mar 17, 11:11 am, kaushik <[email protected]> wrote:
> I want to add multiple columns in or option, eg.
>
> select * from blog where (keyword like '%xyz%' or title like '%xyz%')
> and is_active = 'Y';
>
> How to arrange it in condition array?
>
> On Mar 12, 11:13 am, Miles J <[email protected]> wrote:
>
> > $this->Model->find('all', array(
> > 'conditions' => array('Model.column LIKE' => '%keyword%')
> > ));
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---