-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
templog.php
56 lines (51 loc) · 1.29 KB
/
templog.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
48
49
50
51
52
53
54
55
56
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="user-scalable=yes, width=device-width">
<title>ARDUINO - Aktuelle Temperatur</title>
</head>
<body>
<table border="1">
<tr>
<td>Datum</td>
<td>Temp 1</td>
<td>Temp 2</td>
<td>Temp 3</td>
<td>Temp 4</td>
<td>Temp 5</td>
<td>Feuchtigkeit</td>
<td>Luftdruk</td>
<td>Temp 6</td>
</tr>
<?php
mysql_connect("localhost","[db]","[password]");
mysql_select_db("[db]");
$sql = "select * from TempLog where id like '%' order by timestamp DESC";
$q_data = mysql_query($sql);
if(mysql_num_rows($q_data) > 0)
{
while($r_data = mysql_fetch_array($q_data))
{
echo "<tr>\n";
echo " <td>".$r_data['timestamp']."</td>\n";
echo " <td>".$r_data['temp1']."</td>\n";
echo " <td>".$r_data['temp2']."</td>\n";
echo " <td>".$r_data['temp3']."</td>\n";
echo " <td>".$r_data['temp4']."</td>\n";
echo " <td>".$r_data['temp5']."</td>\n";
echo " <td>".$r_data['feucht']."</td>\n";
echo " <td>".$r_data['druck']."</td>\n";
echo " <td>".$r_data['temp6']."</td>\n";
echo "</tr>\n";
}
}
else
{
$E = 1;
$M = "Es wurden keine Temperaturwerte in der Datenbank gefunden!";
}
?>
</table>
</body>
</html>