-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.php
More file actions
38 lines (36 loc) · 1007 Bytes
/
test.php
File metadata and controls
38 lines (36 loc) · 1007 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<html>
<head>
<title> PHP Test Script </title>
</head>
<body>
<?php
include 'connector.php';
$result = $mysqli->query('SELECT Daily_total FROM zones WHERE Zone_num = 1');
if(!$result){
die('Could not retrieve data: ' . mysql_error());
}
else{
$row = mysqli_fetch_array($result);
$data = new stdClass();
$data->value = $row['Daily_total'];
$data->color = "#68dff0";
$json_data = json_encode($data);
echo $json_data;
}
$mysqli->close();
?>
<br>
<?php
include 'connector.php';
$result = $mysqli->query('SELECT Daily_total FROM zones WHERE zone_num = 1');
if(!$result){
die('Could not retrieve data: ' . mysql_error());
}
else{
$row = mysqli_fetch_array($result);
echo $row['Daily_total'];
}
$mysqli->close();
?>
</body>
</html>