aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/db
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2006-01-25 21:01:52 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2006-01-25 21:01:52 +0000
commit90385cd79a550b4ac08e10e3b8a01abc37965bd4 (patch)
tree87838a4580032f81b981a0867cd2b766d3d81ab6 /phpBB/includes/db
parent964615eb0799b2d20d9578af9e328fb1a348d8da (diff)
downloadforums-90385cd79a550b4ac08e10e3b8a01abc37965bd4.tar
forums-90385cd79a550b4ac08e10e3b8a01abc37965bd4.tar.gz
forums-90385cd79a550b4ac08e10e3b8a01abc37965bd4.tar.bz2
forums-90385cd79a550b4ac08e10e3b8a01abc37965bd4.tar.xz
forums-90385cd79a550b4ac08e10e3b8a01abc37965bd4.zip
- moved add_log out of functions_admin (this file should only be included in admin/admin-related pages)
- fixed cookie based topic tracking - added missing config variables - other minor things git-svn-id: file:///svn/phpbb/trunk@5494 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/db')
-rw-r--r--phpBB/includes/db/dbal.php11
-rw-r--r--phpBB/includes/db/mysql.php8
-rw-r--r--phpBB/includes/db/mysql4.php8
3 files changed, 26 insertions, 1 deletions
diff --git a/phpBB/includes/db/dbal.php b/phpBB/includes/db/dbal.php
index c8b0eebc76..68f2f97ade 100644
--- a/phpBB/includes/db/dbal.php
+++ b/phpBB/includes/db/dbal.php
@@ -213,7 +213,16 @@ class dbal
}
else
{
- $message .= '<br /><br />' . $user->lang['SQL_ERROR_OCCURRED'];
+ // If error occurs in initiating the session we need to use a pre-defined language string
+ // This could happen if the connection could not be established for example (then we are not able to grab the default language)
+ if (!isset($user->lang['SQL_ERROR_OCCURRED']))
+ {
+ $message .= '<br /><br />An sql error occurred while fetching this page. Please contact an administrator if this problem persist.';
+ }
+ else
+ {
+ $message .= '<br /><br />' . $user->lang['SQL_ERROR_OCCURRED'];
+ }
}
if ($this->transaction)
diff --git a/phpBB/includes/db/mysql.php b/phpBB/includes/db/mysql.php
index 57aad449d4..36dd73204c 100644
--- a/phpBB/includes/db/mysql.php
+++ b/phpBB/includes/db/mysql.php
@@ -285,6 +285,14 @@ class dbal_mysql extends dbal
*/
function _sql_error()
{
+ if (!$this->db_connect_id)
+ {
+ return array(
+ 'message' => @mysql_error(),
+ 'code' => @mysql_errno()
+ );
+ }
+
return array(
'message' => @mysql_error($this->db_connect_id),
'code' => @mysql_errno($this->db_connect_id)
diff --git a/phpBB/includes/db/mysql4.php b/phpBB/includes/db/mysql4.php
index 9db47f37ee..aa8e22c058 100644
--- a/phpBB/includes/db/mysql4.php
+++ b/phpBB/includes/db/mysql4.php
@@ -288,6 +288,14 @@ class dbal_mysql4 extends dbal
*/
function _sql_error()
{
+ if (!$this->db_connect_id)
+ {
+ return array(
+ 'message' => @mysql_error(),
+ 'code' => @mysql_errno()
+ );
+ }
+
return array(
'message' => @mysql_error($this->db_connect_id),
'code' => @mysql_errno($this->db_connect_id)