-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathload.php
47 lines (36 loc) · 1.56 KB
/
load.php
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
39
40
41
42
43
44
45
46
47
<?php
// include 'load.php'
$koneksi = mysqli_connect('localhost', 'root', '', 'gh');
$qlsub=
$result = mysqli_query($koneksi,"SELECT *,DATE_FORMAT(waktu, '%y-%m-%d-%H:%i') AS waktu FROM sensor ORDER BY id_no desc limit 12 ") or die(mysql_error());
if (mysqli_num_rows($result) > 0) {
$sens["waktu"] = '';
$sens["sensor1"] = '';
$sens["sensor2"] = '';
$sens["sensor3"] = '';
$sens["sensor4"] = '';
$sens["sensor5"] = '';
$sens["sensor6"] = '';
$sens["ph1"] = '';
$sens["ph2"] = '';
$sens["ph3"] = '';
$sens["ph4"] = '';
$sens["ph5"] = '';
$sens["ph6"] = '';
while ($row = mysqli_fetch_array($result)) {
$sens["waktu"] .= ''.$row['waktu'].',';
$sens["sensor1"] .= ''.$row['sensor1'].',';
$sens["sensor2"] .= ''.$row['sensor2'].',';
$sens["sensor3"] .= ''.$row['sensor3'].',';
$sens["sensor4"] .= ''.$row['sensor4'].',';
$sens["sensor5"] .= ''.$row['sensor5'].',';
$sens["sensor6"] .= ''.$row['sensor6'].',';
$sens["ph1"] .= ''.$row['ph1'].',';
$sens["ph2"] .= ''.$row['ph2'].',';
$sens["ph3"] .= ''.$row['ph3'].',';
$sens["ph4"] .= ''.$row['ph4'].',';
$sens["ph5"] .= ''.$row['ph5'].',';
$sens["ph6"] .= ''.$row['ph6'].',';
}
}
?>