$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->condition = "username != '$name' AND logID = :id";
$criteria->params = array (
':id' => $id,
);
$dataProvider = Disnotification::model()->findAll( $criteria );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With