www/getnode.php

changeset 572
7a03181d29a3
parent 296
69fadd1aded2
equal deleted inserted replaced
571:468377312726 572:7a03181d29a3
11 $query = "SELECT * FROM mon_nodes WHERE uuid=".$uuid.""; 11 $query = "SELECT * FROM mon_nodes WHERE uuid=".$uuid."";
12 $mysqli = new mysqli(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME); 12 $mysqli = new mysqli(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
13 $result = $mysqli->query($query); 13 $result = $mysqli->query($query);
14 //Copy result into a associative array 14 //Copy result into a associative array
15 $resultArray = $result->fetch_array(MYSQLI_ASSOC); 15 $resultArray = $result->fetch_array(MYSQLI_ASSOC);
16 if ($resultArray['online'] == 'Y') {
17 $resultArray['online'] = 1;
18 } else {
19 $resultArray['online'] = 0;
20 }
21 header("Content-type: application/json"); 16 header("Content-type: application/json");
22 echo json_encode($resultArray); 17 echo json_encode($resultArray);

mercurial