摘要:
$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->addCondition('id=1','O 阅读全文
摘要:
$connection=Yii::app()->db;$sql="SELECT*FROM`project`ORDERBYidDESC";$command=$connection->createCommand($sql);$result=$command->queryAll();print_r($result); $db=Yii::app()->db;//youhavetodefinedbconnectioninconfig/main.php$sql="selectsum(if(starttime>'09:00:00', 阅读全文