find()查找指定的条件
$modelName::model->find();
使用条件对象
$criteria = new CDbCriteria(); $criteria->select = array(‘uid‘,‘username‘,‘info‘); $criteria->order = ‘uid desc‘;$criteria->find($criteria);
也可以这样
$modelName::model()->find(array( ‘select‘=>array(‘uid‘,‘username‘,‘info‘), ‘order‘=>‘uid desc‘, ‘condition‘=>‘uid = :uid‘, ‘params‘=>array(‘:uid‘=>2), ));
时间: 2024-10-10 11:23:49