1

When your query is not correct, php returns an error message like following one:

Uncaught exception 'PDOException' with message 'SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '@aaa.com)' at line 1' in C:\Program Files\...

Is there a way to force it to display full MySQL query string in error message?

Update:

I need a solution that works in entire web site (in development stage).

Perhaps via php.ini of my.ini

I currently use ZF for database interaction.

ThiefMaster
  • 310,957
  • 84
  • 592
  • 636
Handsome Nerd
  • 17,114
  • 22
  • 95
  • 173

1 Answers1

3
$stmt = /* PDOStatement */
if (!$stmt->execute()) {

    echo $stmt->queryString;
}
Andreas Linden
  • 12,489
  • 7
  • 51
  • 67