Fixed problem with missing query errors, noticed in installer but I seem to remember...
authorTim Starling <tstarling@users.mediawiki.org>
Fri, 14 Jan 2005 13:00:17 +0000 (13:00 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Fri, 14 Jan 2005 13:00:17 +0000 (13:00 +0000)
includes/Database.php

index 0deaf93..b30c54b 100644 (file)
@@ -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