diff --git a/cake/libs/model/datasources/dbo_source.php b/cake/libs/model/datasources/dbo_source.php index e9f14e52261..4eacfcfdced 100755 --- a/cake/libs/model/datasources/dbo_source.php +++ b/cake/libs/model/datasources/dbo_source.php @@ -299,8 +299,7 @@ public function execute($sql, $options = array(), $params = array()) { if ($options['log']) { $this->took = round((microtime(true) - $t) * 1000, 0); - $this->affected = $this->lastAffected(); - //$this->numRows = $this->lastNumRows(); + $this->numRows = $this->affected = $this->lastAffected(); $this->logQuery($sql); } @@ -376,14 +375,7 @@ function lastAffected($source = null) { * @return integer Number of rows in resultset */ function lastNumRows($source = null) { - if ($this->hasResult()) { - $i = 0; - foreach ($this->_result as $row) { - $i++; - } - return $i; - } - return null; + return $this->lastAffected($source); } /**