Getting raw SQL query string from PDO prepared statements

前端 未结 16 861
心在旅途
心在旅途 2020-11-22 06:56

Is there a way to get the raw SQL string executed when calling PDOStatement::execute() on a prepared statement? For debugging purposes this would be extremely useful.

16条回答
  •  感情败类
    2020-11-22 07:26

    PDOStatement has a public property $queryString. It should be what you want.

    I've just notice that PDOStatement has an undocumented method debugDumpParams() which you may also want to look at.

提交回复
热议问题