<?php
+# $Id$
# Backwards compatibility wrapper for Database.php
# not access the $wgDatabase variable directly unless
# you intend to set it. Use wfGetDB().
-include_once( "Database.php" );
+$wgIsMySQL=false;
+$wgIsPg=false;
+
+if ($wgDBtype=="mysql") {
+ require_once( "Database.php" );
+ $wgIsMySQL=true;
+} elseif ($wgDBtype=="pgsql") {
+ require_once( "DatabasePostgreSQL.php" );
+ $wgIsPg=true;
+}
# Query the database
# $db: DB_READ = -1 read from slave (or only server)
return $db->fetchObject( $res );
}
+function wfFetchRow( $res )
+{
+ $db =& wfGetDB();
+ return $db->fetchRow ( $res );
+}
+
function wfNumRows( $res )
{
$db =& wfGetDB();
return $db->set( $table, $var, $value, $cond );
}
-function wfGetSQL( $table, $var, $cond )
+function wfGetSQL( $table, $var, $cond="" )
{
$db =& wfGetDB();
return $db->get( $table, $var, $cond );
return $db->getArray( $table, $vars, $conds, $fname );
}
+function wfUpdateArray( $table, $values, $conds, $fname = "wfUpdateArray" )
+{
+ $db =& wfGetDB();
+ $db->updateArray( $table, $values, $conds, $fname );
+}
+
?>