www/getco2meter.php

Thu, 10 Oct 2019 22:19:29 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Thu, 10 Oct 2019 22:19:29 +0200
changeset 503
b23ef14c6b09
child 505
c09b67fd8323
permissions
-rw-r--r--

Web pages for the CO2 meters added.

<?php

require_once('config.php');

if (isset($_GET["uuid"]))
	    $uuid = $_GET["uuid"];
else
	    $uuid = "'ef166f25-1bb4-4bef-b112-a867af77f766'";


$mysqli = new mysqli(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
$query = "SELECT * FROM mon_co2meters WHERE uuid=".$uuid."";
$result = $mysqli->query($query);
$resultArray = $result->fetch_array(MYSQLI_ASSOC);
header("Content-type: application/json");
echo json_encode($resultArray);

mercurial