diff --git a/dblayeroo.php b/dblayeroo.php index 72c8f6a..c49501e 100644 --- a/dblayeroo.php +++ b/dblayeroo.php @@ -3173,12 +3173,6 @@ class dblayeroo $this->debugLog ("'",$this->getDisplayQuery (),"'"); $startTime = microtime (true); $st->execute (); - self::$meta[] = array ( - "command" => $this->command, - "sql" => $sql, - "sqltime" => microtime (true) - $startTime, - "displayQuery" => $this->getDisplayQuery (), - ); switch ($this->command) { case "SELECT": @@ -3256,8 +3250,22 @@ class dblayeroo unset ($result[$rownb][$colNb]); } } + self::$meta[] = array ( + "command" => $this->command, + "sql" => $sql, + "sqltime" => microtime (true) - $startTime, + "displayQuery" => $this->getDisplayQuery (), + "nbrows" => count ($result), + ); return $result; case "INSERT": + self::$meta[] = array ( + "command" => $this->command, + "sql" => $sql, + "sqltime" => microtime (true) - $startTime, + "displayQuery" => $this->getDisplayQuery (), + "nbrows" => $st->rowCount (), + ); // If the primary key is not autoincrement, return the provided value if // exists if (! in_array ("autoincrement", $this->fields[$this->primary]) && @@ -3293,6 +3301,13 @@ class dblayeroo return self::$instance[$this->dsn]->lastInsertId ($autoInc); case "UPDATE": case "DELETE": + self::$meta[] = array ( + "command" => $this->command, + "sql" => $sql, + "sqltime" => microtime (true) - $startTime, + "displayQuery" => $this->getDisplayQuery (), + "nbrows" => $st->rowCount (), + ); return $st->rowCount (); default: $this->DBException ("execute : command not defined : no RC");