'conditions' => array('Book.title LIKE' => 'S%'), NOT:
'conditions' => array('Book.title' => 'LIKE S%'), On Mar 10, 4:11 pm, Glikis <nikosgli...@gmail.com> wrote: > Everything is explained in the link. > > http://bin.cakephp.org/view/1645372860 > > can anyone tell me my mistake ? thank you for you time! > > -------------- > > link says: > > //i write this in the controller > $books = $this->Book->find('all', > array( > 'conditions' => array('Book.title' => 'LIKE S > %'), > > 'fields' => array ( > > 'Book.isbn', > > 'Book.title', > > 'Book.author_name' > > ), > > 'order' => 'Book.isbn DESC', > > 'limit' =>2 > ) > ); > $this->set('books',$books); > //and i get this sql query which is wrong > > SELECT `Book`.`isbn`, `Book`.`title`, `Book`.`author_name` FROM > `books` AS `Book` WHERE `Book`.`title` = 'LIKE S%' ORDER BY > `Book`.`isbn` DESC LIMIT 2 > > title = 'LIKE S%' > > i want title like '%S' > i copied this from a book, i don't think i copied something wrong > thank you Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To unsubscribe from this group, send email to cake-php+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en