From 6c5254e2dbc9bbbeece7f93aa99bbfae0147a350 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Mon, 21 Jun 2004 07:31:41 +0000 Subject: [PATCH] allowing calls to getArray with no conditions --- includes/Database.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/includes/Database.php b/includes/Database.php index 0d48fe4431..134d53b3cb 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -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; -- 2.20.1