I am running a Mysql query in CakePHP but it is not outputting any result though no error is displayed.
Mysql query is this:
SELECT `isbn`, `title`, `author_name` FROM `books` WHERE `author_name` = 'William Rice' AND `title` LIKE '%Course%' ORDER BY `title` ASC
and it outputs results.
And I have written this in CakePHP find function:
$books = $this->Book->find('all', array('fields'=>array('Book.isbn', 'Book.title', 'Book.author_name'),
'conditions'=>array('Book.author_name'=>'William Rice',
'AND'=>array('Book.title'=>'LIKE %Course%')),
'order'=>'Book.title ASC',
));
But the query doesn't run. Is AND condition specified like this? Please have a look at it and tell me where is it wrong. Thanks.