dblayeroo : add the nb of rows in meta
git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@5089 bf3deb0d-5f1a-0410-827f-c0cc1f45334c
This commit is contained in:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user