From cb552159ac03506be34066906de5830738c3b707 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Thu, 27 Dec 2018 09:44:43 +0100 Subject: [PATCH] Add new "network" API endpoint to database API Signed-off-by: DL6ER --- api_db.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/api_db.php b/api_db.php index daa04813..5ddde06e 100644 --- a/api_db.php +++ b/api_db.php @@ -94,6 +94,19 @@ if(!$db) die("Error connecting to database"); } +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)) + array_push($network, $res); + + $data = array_merge($data, array('network' => $network)); +} + if (isset($_GET['getAllQueries']) && $auth) { $allQueries = array();