Yii, update record (update query) method

Update By Primary Key
Model::model()->updateByPk($Model->id,array("status"=>'ok'));


Update All Rows
Model::model()->updateAll(array('user'=>"$userid",'date'=>$currenttime),"status=>'ok'");

1 comment

Leave a comment

Your email address will not be published. Required fields are marked *