From 6da2d9167f9568c0cb1bf400a1aa7c65a4e6bc10 Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Fri, 8 Mar 2019 08:23:43 +0000 Subject: [PATCH] dblayeroo : add the nb of rows in meta git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@5089 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- dblayeroo.php | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) 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");