Number Of Affected Rows

In Yii, is there a method which returns the number of affected rows from most recent query?

Something like


in CodeIgniter ( ).

I looked at CDbConnection methods but I couldn’t find anything.


Some methods like updateAll, deleteAll return this number as a result.

Internally they just return $command->execute();



$affected_rows = Yii::app()->db->createCommand( 'UPDATE ...' )->execute();

That’s too easy :D But I don’t want to execute a command/query, I need the number of affected rows from the most recent query (executed in the past without explicitly saving the number of rows).