tags:

views:

76

answers:

2

I am new to cakephp & don't know what is the syntax to use LIKE & OR operator in cakephp with mysql.

Can anyone help me? Thanks..

+1  A: 

Complex find conditions from the manual:

$this->Post->find('first', array (
    "Author.name" => "Bob", 
    "OR" => array (
        "Post.title LIKE" => "%magic%",
        "Post.created >" => date('Y-m-d', strtotime("-2 weeks"))
    )
));
bancer