开发者

PDO queryString with binded data

开发者 https://www.devze.com 2023-03-15 11:29 出处:网络
If I have a prepared statement like SELECT * FROM users WHERE userid = :userid开发者_StackOverflow社区, i can read this SQL statement via PDOStatement::$queryString. For logging i want to have the str

If I have a prepared statement like SELECT * FROM users WHERE userid = :userid开发者_StackOverflow社区, i can read this SQL statement via PDOStatement::$queryString. For logging i want to have the string, which is executed, e.g. ... WHERE userid = 42. How do i get this string?


PDOStatement->debugDumpParams is what you want. You may need to use output buffering though as the results are echoed out.

0

精彩评论

暂无评论...
验证码 换一张
取 消