PDO queryString with binded data

霸气de小男生 提交于 2019-12-10 13:46:01

问题


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.



来源:https://stackoverflow.com/questions/6491711/pdo-querystring-with-binded-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!