From 5793fd7ddbf34548785cd0a8c34119d877144e50 Mon Sep 17 00:00:00 2001 From: Domas Mituzas Date: Sat, 15 Jul 2006 19:22:37 +0000 Subject: [PATCH] use object error retrieval functions, that work properly within connection context --- includes/Database.php | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/includes/Database.php b/includes/Database.php index f8e579b481..79de31346a 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -760,8 +760,8 @@ class Database { */ function fetchObject( $res ) { @/**/$row = mysql_fetch_object( $res ); - if( mysql_errno() ) { - throw new DBUnexpectedError( $this, 'Error in fetchObject(): ' . htmlspecialchars( mysql_error() ) ); + if( $this->lastErrno() ) { + throw new DBUnexpectedError( $this, 'Error in fetchObject(): ' . htmlspecialchars( $this->lastError() ) ); } return $row; } @@ -772,8 +772,8 @@ class Database { */ function fetchRow( $res ) { @/**/$row = mysql_fetch_array( $res ); - if (mysql_errno() ) { - throw new DBUnexpectedError( $this, 'Error in fetchRow(): ' . htmlspecialchars( mysql_error() ) ); + if ( $this->lastErrno() ) { + throw new DBUnexpectedError( $this, 'Error in fetchRow(): ' . htmlspecialchars( $this->lastError() ) ); } return $row; } @@ -783,8 +783,8 @@ class Database { */ function numRows( $res ) { @/**/$n = mysql_num_rows( $res ); - if( mysql_errno() ) { - throw new DBUnexpectedError( $this, 'Error in numRows(): ' . htmlspecialchars( mysql_error() ) ); + if( $this->lastErrno() ) { + throw new DBUnexpectedError( $this, 'Error in numRows(): ' . htmlspecialchars( $this->lastError() ) ); } return $n; } -- 2.20.1