$id = Yii::app()->user->getState("logId");
$name = Yii::app()->user->getState("username");
$dataProvider=Disnotification::model->findAllByAttributes(array('logID' => $id,'username'!=$name));
How can I find records which equals to $id
but not equals to $name
?
$criteria = new CDbCriteria();
$criteria->compare('logID' , $id);
$criteria->addCondition('username != :username');
$criteria->params[ ':username' ] = $name;
$dataProvider = Disnotification::model()->findAll( $criteria );