$c->add(TblUsersPeer::USR_TYPE,array(2,3,6),Criteria::IN);
$c1 = $c->getNewCriterion(TblUsersPeer::USR_PARENTID,$this->getUser()->getAttribute(‘userid’),Criteria::EQUAL);
$c2 = $c->getNewCriterion(TblUsersPeer::USR_PARENTID,null, Criteria::ISNULL);
$c1->addOr($c2);
$c->add($c1);

One thought on “How to add or condition in mysql query in symfony”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.