$cs = new Criteria();
$criterion = $cs->getNewCriterion(HfArticlesPeer::AR_DESCRIPTION,’%’.$searchText.’%’,Criteria::LIKE);
$criterion->addOr($cs->getNewCriterion(HfArticlesPeer::AR_TITLE,’%’.$searchText.’%’,Criteria::LIKE));
$criterion1 = $cs->getNewCriterion(HfArticlesPeer::AR_STATUS,’ARCHIVE’,Criteria::EQUAL);
$criterion1->addOr($cs->getNewCriterion(HfArticlesPeer::AR_STATUS,’PUBLISHED’,Criteria::EQUAL));
$cs->add($criterion1);
$cs->add($criterion);
$cs->add(HfArticlesPeer::AR_CATEGORY ,InsuranceCatId,Criteria::EQUAL);
$searchResInsuranceArticle = HfArticlesPeer::doSelect($cs);
One thought on “How to apply or condition for mysql query in symfony”
Leave a Reply
You must be logged in to post a comment.
Dude..
atlest explain everything!! 🙂
thnx