From: Tim Starling Date: Mon, 21 Jun 2004 07:31:41 +0000 (+0000) Subject: allowing calls to getArray with no conditions X-Git-Tag: 1.5.0alpha1~2804 X-Git-Url: https://git.cyclocoop.org/%28%28?a=commitdiff_plain;h=6c5254e2dbc9bbbeece7f93aa99bbfae0147a350;p=lhc%2Fweb%2Fwiklou.git allowing calls to getArray with no conditions --- 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;