1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-07-30 21:40:43 +02:00

show correct SQL error message if failed during a transaction...

git-svn-id: file:///svn/phpbb/trunk@4788 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2004-02-03 09:43:31 +00:00
parent 40931f12ba
commit 129218286b
8 changed files with 45 additions and 37 deletions

View File

@@ -363,15 +363,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 = '<u>SQL ERROR</u> [ ' . SQL_LAYER . ' ]<br /><br />' . @sqlite_error_string(@sqlite_last_error($this->db_connect_id)) . '<br /><br /><u>CALLING PAGE</u><br /><br />' . htmlspecialchars($this_page) . (($sql != '') ? '<br /><br /><u>SQL</u><br /><br />' . $sql : '') . '<br />';
if ($this->transaction)
{
$this->sql_transaction('rollback');
}
trigger_error($message, E_USER_ERROR);
}