note 129901 added to pdostatement.debugdumpparams
| From: | wchasroth@gmail.com | Date: | Fri, 06 Dec 2024 19:41:52 +0000 |
| Subject: | note 129901 added to pdostatement.debugdumpparams | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-221704@lists.php.net to get a copy of this message | ||
Using PHP 8.3 and MySQL 8.2, debugDumpParams() DOES display the "raw" SQL, with parameter
values.
E.g.
$sql = "SELECT tid, miv_title, ballot_order FROM title WHERE tid LIKE :tid AND ballot_order =
:order";
$stm = $pdo->prepare($sql);
$stm->bindValue(":tid", "mi:%");
$stm->bindValue(":order", 5000, PDO::PARAM_INT);
$stm->execute();
$stm->debugDumpParams();
... displays ...
SQL: [92] SELECT tid, miv_title, ballot_order FROM title WHERE tid LIKE :tid AND ballot_order =
:order
Sent SQL: [92] SELECT tid, miv_title, ballot_order FROM title WHERE tid LIKE 'mi:%' AND
ballot_order = 5000
Params: 2
Key: Name: [4] :tid
paramno=-1
name=[4] ":tid"
is_param=1
param_type=2
Key: Name: [6] :order
paramno=-1
name=[6] ":order"
is_param=1
param_type=1
----
Server IP: 45.112.84.4
Probable Submitter: 80.90.5.137 (proxied: 2601:400:8000:48:e827:fa80:759a:2b1c)
----
Manual Page -- https://php.net/manual/en/pdostatement.debugdumpparams.php
Edit -- https://main.php.net/note/edit/129901
Del: integrated -- https://main.php.net/note/delete/129901/integrated
Del: useless -- https://main.php.net/note/delete/129901/useless
Del: bad code -- https://main.php.net/note/delete/129901/bad+code
Del: spam -- https://main.php.net/note/delete/129901/spam
Del: non-english -- https://main.php.net/note/delete/129901/non-english
Del: in docs -- https://main.php.net/note/delete/129901/in+docs
Del: other reasons-- https://main.php.net/note/delete/129901
Reject -- https://main.php.net/note/reject/129901
Search -- https://main.php.net/manage/user-notes.php