www/getfermenter.php

Wed, 10 Aug 2022 15:40:20 +0200

author
Michiel Broek <mbroek@mbse.eu>
date
Wed, 10 Aug 2022 15:40:20 +0200
changeset 838
ce5f39b66a51
parent 572
7a03181d29a3
permissions
-rw-r--r--

Switch co2pressure graph to MySQL

4
1750b6cae48e Web pages nodes display works.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
1 <?php
1750b6cae48e Web pages nodes display works.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
2
1750b6cae48e Web pages nodes display works.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
3 require_once('config.php');
1750b6cae48e Web pages nodes display works.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
4
1750b6cae48e Web pages nodes display works.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
5 if (isset($_GET["uuid"]))
1750b6cae48e Web pages nodes display works.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
6 $uuid = $_GET["uuid"];
1750b6cae48e Web pages nodes display works.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
7 else
1750b6cae48e Web pages nodes display works.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
8 $uuid = "'ef166f25-1bb4-4bef-b112-a867af77f766'";
1750b6cae48e Web pages nodes display works.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
9
1750b6cae48e Web pages nodes display works.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
10
1750b6cae48e Web pages nodes display works.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
11 $mysqli = new mysqli(DBASE_HOST,DBASE_USER,DBASE_PASS,DBASE_NAME);
43
dcb9ff8846fa Renamed monitor database tables
Michiel Broek <mbroek@mbse.eu>
parents: 7
diff changeset
12 $query = "SELECT * FROM mon_fermenters WHERE uuid=".$uuid."";
4
1750b6cae48e Web pages nodes display works.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
13 $result = $mysqli->query($query);
1750b6cae48e Web pages nodes display works.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
14 $resultArray = $result->fetch_array(MYSQLI_ASSOC);
296
69fadd1aded2 Updated design document. Add content header application/json to all scripts that produce json output. Chart prints show the beer code and name in the header. Charts don't display the menu anymore.
Michiel Broek <mbroek@mbse.eu>
parents: 180
diff changeset
15 header("Content-type: application/json");
4
1750b6cae48e Web pages nodes display works.
Michiel Broek <mbroek@mbse.eu>
parents:
diff changeset
16 echo json_encode($resultArray);

mercurial