From 129218286b21a19d0bf8b79aef373e9630e5bc82 Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Tue, 3 Feb 2004 09:43:31 +0000 Subject: show correct SQL error message if failed during a transaction... git-svn-id: file:///svn/phpbb/trunk@4788 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/db/mysql.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'phpBB/includes/db/mysql.php') diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php index b031047218..5c982e7a2c 100644 --- a/phpBB/includes/db/mysql.php +++ b/phpBB/includes/db/mysql.php @@ -357,15 +357,16 @@ class sql_db { if (!$this->return_on_error) { - if ($this->transaction) - { - $this->sql_transaction('rollback'); - } - $this_page = (!empty($_SERVER['PHP_SELF'])) ? $_SERVER['PHP_SELF'] : $_ENV['PHP_SELF']; $this_page .= '&' . ((!empty($_SERVER['QUERY_STRING'])) ? $_SERVER['QUERY_STRING'] : $_ENV['QUERY_STRING']); $message = 'SQL ERROR [ ' . SQL_LAYER . ' ]

' . @mysql_error() . '

CALLING PAGE

' . htmlspecialchars($this_page) . (($sql != '') ? '

SQL

' . $sql : '') . '
'; + + if ($this->transaction) + { + $this->sql_transaction('rollback'); + } + trigger_error($message, E_USER_ERROR); } -- cgit v1.2.1