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 cake-php@googlegroups.com
To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
No comments:
Post a Comment