Saturday, July 13, 2013

CDbCriteria with condition


 $sitelinks = Sitelink::model()->find('activation=:activation AND category=:category',
array(
   ':activation'=>1,
   ':category'=>$catname->id,
));


$criteria = new CDbCriteria; $criteria->condition='activation=:activation AND category=:category'; $criteria->params=array(':activation'=>1, ':category'=>$catname->id); $sitelinks = Sitelink::model()->find($criteria);

No comments:

Post a Comment