From: Domas Mituzas Date: Thu, 10 Jun 2004 13:02:27 +0000 (+0000) Subject: added wfFetchRow() besides wfFetchObject. Used by objectcache code X-Git-Tag: 1.5.0alpha1~2943 X-Git-Url: https://git.cyclocoop.org/admin/?a=commitdiff_plain;h=83a3aa9f8f4dd8a19da5f825972bba16d3aaf02b;p=lhc%2Fweb%2Fwiklou.git added wfFetchRow() besides wfFetchObject. Used by objectcache code --- 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) ) {