diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php index 4964ac87f7..61344a0674 100644 --- a/phpBB/includes/db/dbal.php +++ b/phpBB/includes/db/dbal.php @@ -45,7 +45,9 @@ class dbal // Holding the last sql query on sql error var $sql_error_sql = ''; - + // Holding the error information - only populated if sql_error_triggered is set + var $sql_error_returned = array(); + // Holding transaction count var $transactions = 0; @@ -544,11 +546,11 @@ class dbal $this->sql_error_triggered = true; $this->sql_error_sql = $sql; - $error = $this->_sql_error(); + $this->sql_error_returned = $this->_sql_error(); if (!$this->return_on_error) { - $message = 'SQL ERROR [ ' . $this->sql_layer . ' ]

' . $error['message'] . ' [' . $error['code'] . ']'; + $message = 'SQL ERROR [ ' . $this->sql_layer . ' ]

' . $this->sql_error_returned['message'] . ' [' . $this->sql_error_returned['code'] . ']'; // Show complete SQL error and path to administrators only // Additionally show complete error on installation or if extended debug mode is enabled