allowing calls to getArray with no conditions
authorTim Starling <tstarling@users.mediawiki.org>
Mon, 21 Jun 2004 07:31:41 +0000 (07:31 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Mon, 21 Jun 2004 07:31:41 +0000 (07:31 +0000)
includes/Database.php

index 0d48fe4..134d53b 100644 (file)
@@ -265,8 +265,12 @@ class Database {
        function getArray( $table, $vars, $conds, $fname = "Database::getArray" )
        {
                $vars = implode( ",", $vars );
-               $where = Database::makeList( $conds, LIST_AND );
-               $sql = "SELECT $vars FROM $table WHERE $where LIMIT 1";
+               if ( $conds !== false ) {
+                       $where = Database::makeList( $conds, LIST_AND );
+                       $sql = "SELECT $vars FROM $table WHERE $where LIMIT 1";
+               } else {
+                       $sql = "SELECT $vars FROM $table LIMIT 1";
+               }
                $res = $this->query( $sql, $fname );
                if ( $res === false || !$this->numRows( $res ) ) {
                        return false;