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
  • 298,938
  • 77
  • 579
  • 623
Handsome Nerd
  • 15,997
  • 20
  • 92
  • 166

1 Answers1

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

    echo $stmt->queryString;
}
Andreas Linden
  • 12,235
  • 7
  • 48
  • 66