From 83a3aa9f8f4dd8a19da5f825972bba16d3aaf02b Mon Sep 17 00:00:00 2001 From: Domas Mituzas Date: Thu, 10 Jun 2004 13:02:27 +0000 Subject: [PATCH] added wfFetchRow() besides wfFetchObject. Used by objectcache code --- includes/Database.php | 13 +++++++++++++ includes/DatabaseFunctions.php | 6 ++++++ includes/DatabasePostgreSQL.php | 9 +++++++++ 3 files changed, 28 insertions(+) diff --git a/includes/Database.php b/includes/Database.php index c1b258dfbd..3209c50ccb 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -1,4 +1,8 @@ fetchObject( $res ); } +function wfFetchRow( $res ) +{ + $db =& wfGetDB(); + return $db->fetchRow ( $res ); +} + function wfNumRows( $res ) { $db =& wfGetDB(); diff --git a/includes/DatabasePostgreSQL.php b/includes/DatabasePostgreSQL.php index 1f43e0b50a..eade5b57a7 100644 --- a/includes/DatabasePostgreSQL.php +++ b/includes/DatabasePostgreSQL.php @@ -209,6 +209,15 @@ class Database { } return $row; } + + function fetchRow( $res ) { + @$row = pg_fetch_array( $res ); + if( pg_last_error($this->mConn) ) { + wfDebugDieBacktrace( "SQL error: " . htmlspecialchars( pg_last_error($this->mConn) ) ); + } + return $row; + } + function numRows( $res ) { @$n = pg_num_rows( $res ); if( pg_last_error($this->mConn) ) { -- 2.20.1