http://book.cakephp.org/view/1030/Complex-Find-Conditions
Jeremy Burns [email protected] On 3 Jun 2010, at 08:04, Ambika Kulkarni wrote: > Hi all, > > In my controller I have the following code snippet. This is used for > searching a product name in campaigns tbl. > > if($product!='' && $product!='empty') { > > $condition=array_merge($condition,array('product'=> > $product)); > > } > $campaign = $this->Campaign->find('all', > array( > 'conditions' => > $condition)); > > Here if i enter the product value as "ABC" then it does a whole word > search. And returns the relevent record. Now I want to do a single > character search, for which we use LIKE operator in query. > > I want to know how to use LIKE operator in cake PHP. > > Do I need to write the condition in this way... > $condition=array_merge($condition,array('product LIKE '=>$product)); > > or is their any other proper way to do this. > > > Thanks all, > > 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 [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 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 [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
