From: Domas Mituzas Date: Sat, 15 Jul 2006 19:22:37 +0000 (+0000) Subject: use object error retrieval functions, that work properly within connection context X-Git-Tag: 1.31.0-rc.0~56238 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=5793fd7ddbf34548785cd0a8c34119d877144e50;p=lhc%2Fweb%2Fwiklou.git use object error retrieval functions, that work properly within connection context --- 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; }