From 9291e8fe507559c15f3006f1182fd3aeb96ac2ea Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 28 Dec 2018 12:18:08 +0100 Subject: [PATCH] Simplify API code Signed-off-by: DL6ER --- api_db.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/api_db.php b/api_db.php index 5ddde06e..ef2ddc34 100644 --- a/api_db.php +++ b/api_db.php @@ -99,9 +99,7 @@ if(isset($_GET["network"]) && $auth) $network = array(); $results = $db->query('SELECT * FROM network'); - if(!is_bool($results)) - $result = $results; - while($res = $results->fetchArray(SQLITE3_ASSOC)) + while($results !== false && $res = $results->fetchArray(SQLITE3_ASSOC)) array_push($network, $res); $data = array_merge($data, array('network' => $network));