From 2682b7db8621c843f1242b450b97c499a6c47a1c Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Fri, 14 Jan 2005 13:00:17 +0000 Subject: [PATCH] Fixed problem with missing query errors, noticed in installer but I seem to remember seeing it before --- includes/Database.php | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/includes/Database.php b/includes/Database.php index 0deaf93944..b30c54bdd9 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -526,13 +526,25 @@ class Database { * Get the last error number * See mysql_errno() */ - function lastErrno() { return mysql_errno(); } + function lastErrno() { + if ( $this->mConn ) { + return mysql_errno( $this->mConn ); + } else { + return mysql_errno(); + } + } /** * Get a description of the last error * See mysql_error() for more details */ - function lastError() { return mysql_error(); } + function lastError() { + if ( $this->mConn ) { + return mysql_error( $this->mConn ); + } else { + return mysql_error(); + } + } /** * Get the number of rows affected by the last write query -- 2.20.1