www/getnodes.php

Tue, 07 Aug 2018 16:42:49 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Tue, 07 Aug 2018 16:42:49 +0200
changeset 2
282e7d2bb28a
child 7
59048cd5f00d
permissions
-rw-r--r--

Initial web server

<?php

require_once('config.php');

$mysqli = new mysqli(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
$result = $mysqli->query("SELECT uuid,node,online,net_address FROM nodes");
//Copy result into a associative array
$resultArray = $result->fetch_all(MYSQLI_ASSOC);
echo json_encode($resultArray);

mercurial