摘要:
8五/110Yii CDbCriteria的常用方法PHP代码$criteria=newCDbCriteria;$criteria->addCondition("id=1");//查询条件,即whereid=1$criteria->addInCondition('id',array(1,2,3,4,5));//代表whereidIN(1,23,,4,5,);$criteria->addNotInCondition('id',array(1,2,3,4,5));//与上面正好相法,是NOTIN$criteria->add 阅读全文
摘要:
一、查询数据集合1、$admin=Admin::model()->findAll($condition,$params);该方法是根据一个条件查询一个集合,如: findAll("username=:name",array(":name"=>$username));2、$admin=Admin::model()->findAllByPk($postIDs,$condition,$params);findAllByPk($id,"name like ':name' and age=:age",array 阅读全文