print "DB user: $wgDBuser\n";
print "DB password: $wgDBpassword\n";
-$res = wfQuery( "SELECT MAX(cur_id) as m FROM cur", DB_READ );
-$row = wfFetchObject( $res );
+$dbr =& wfGetDB( DB_SLAVE );
+$cur = $dbr->tableName( 'cur' );
+$res = $dbr->query( "SELECT MAX(cur_id) as m FROM $cur" );
+$row = $dbr->fetchObject( $res );
print "Max cur_id: {$row->m}\n";
?>