diff --git a/main/inc/lib/database.lib.php b/main/inc/lib/database.lib.php index c2392ca535..96bfc9712d 100755 --- a/main/inc/lib/database.lib.php +++ b/main/inc/lib/database.lib.php @@ -738,9 +738,10 @@ class Database { * @param resource The result from a call to sql_query (e.g. Database::query) * @param string Optional: "ASSOC","NUM" or "BOTH", as the constant used in mysql_fetch_array. * @return array Array of results as returned by php - * @author Yannick Warnier + * @author Yannick Warnier */ public static function fetch_array($result, $option = 'BOTH') { + if ($result === false) { return array(); } return $option == 'ASSOC' ? mysql_fetch_array($result, MYSQL_ASSOC) : ($option == 'NUM' ? mysql_fetch_array($result, MYSQL_NUM) : mysql_fetch_array($result)); } @@ -1521,4 +1522,4 @@ class Database { } } -//end class Database \ No newline at end of file +//end class Database