If I have a prepared statement like SELECT * FROM users WHERE userid = :userid
, 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?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
PDOStatement->debugDumpParams is what you want. You may need to use output buffering though as the results are echoed out.