From: Tim Starling Date: Fri, 14 Jan 2005 13:00:17 +0000 (+0000) Subject: Fixed problem with missing query errors, noticed in installer but I seem to remember... X-Git-Tag: 1.5.0alpha1~945 X-Git-Url: http://git.cyclocoop.org/geomaker.php?a=commitdiff_plain;h=2682b7db8621c843f1242b450b97c499a6c47a1c;p=lhc%2Fweb%2Fwiklou.git Fixed problem with missing query errors, noticed in installer but I seem to remember seeing it before --- 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