Code: Select all
<?php
$query = "SELECT * FROM temphistory WHERE `iChipID` = '$theSerial' " ;
$temps = mysql_query($query) or die ("Couldn't execute query.");
$times = array("NA","NA","00:00","01:00","02:00","03:00","04:00","05:00","06:00","07:00","08:00","09:00","10:00","11:00","12:00","13:00","14:00","15:00","16:00","17:00","18:00","19:00","20:00","21:00","22:00","23:00") ;
$row = mysql_fetch_row($temps);
//output the arrays in HTML to a table
echo '<table border="1">';
echo '<tr><td>Time</td><td>Temperature</td></tr>';
for($i=2;$i<=25;$i++)
{
echo "<tr>\n
<td>$times[$i]</td>\n
<td style='text-align: right'>$row[$i]</td>\n
</tr>\n";
}
echo "</table>\n";
?>
[text]
Time Temperature
00:00
01:00
02:00
03:00
04:00
05:00
06:00
07:00
08:00
09:00
10:00
11:00
12:00
13:00
14:00
15:00
16:00
17:00
18:00
19:00
20:00
21:00
22:00
23:00
[/text]