Retrieve (or simulate) full query from PDO prepared statement

后端 未结 5 1672
孤城傲影
孤城傲影 2020-12-01 14:50

I stumbled upon this question from two years ago.

Is there a way to get the raw SQL string executed when calling PDOStatement::execute() on a prepare

5条回答
  •  失恋的感觉
    2020-12-01 15:15

    Afaik, PDO doesn't really expose it to you. On development servers, you could enable the general query log for MySQL (if that's what you use), with possibly more control with sql_log_off, which does require the SUPER privilege.

提交回复
热议问题