picodb: when logging SQL, include params as well

This commit is contained in:
Joe Nahmias 2022-08-21 22:52:03 -04:00 committed by Frédéric Guillot
parent bff5c15544
commit e3b9b2ce8f
1 changed files with 2 additions and 0 deletions

View File

@ -269,11 +269,13 @@ class StatementHandler
foreach ($this->positionalParams as $value) {
$pdoStatement->bindValue($i, $value, PDO::PARAM_STR);
$this->db->setLogMessage("param[$i]: $value");
$i++;
}
foreach ($this->namedParams as $name => $value) {
$pdoStatement->bindValue($name, $value, PDO::PARAM_STR);
$this->db->setLogMessage("param[$name]: $value");
}
}