Min and Max value for current date
Posted: Wed Jan 05, 2011 5:19 am
I have database with meteorogical data and I extract some data from last row and put it in html table http://www.webwork.host56.com/
For Min and Max temp I need min and max value for current day (date).
How can I achieve that task and how to store these values in my html table.
Here is the part of my code:
For Min and Max temp I need min and max value for current day (date).
How can I achieve that task and how to store these values in my html table.
Here is the part of my code:
Code: Select all
$query="SELECT * FROM trosarina ORDER BY id DESC LIMIT 1";
$trosarina=mysql_query($query);
echo "<table border='1'>";
echo "<tr> <th>Lokacija</th> <th>Datum</th> <th>Vreme</th> <th>Temperatura</th> <th>Max temp</th> <th>Min temp</th> <th>Vlaznost</th> <th>Pritisak</th> <th>Pravac vetra</th> <th>Brzina vetra</th> <th>Max udar vetra</th></tr>";
$row = mysql_fetch_array($trosarina) or die(mysql_error());
echo "<tr><td>";
echo $row['Lokacija'];
echo "</td><td>";
echo $row['Datum'];
echo "</td><td>";
echo $row['Vreme'];
echo "</td><td>";
echo $row['Temperatura'];
echo "</td><td>";
echo $row['Max_Temp'];
echo "</td><td>";
echo $row['Min_Temp'];
echo "</td><td>";
echo $row['Vlaznost'];
echo "</td><td>";
echo $row['Pritisak'];
echo "</td><td>";
echo $row['Pravac_vetra'];
echo "</td><td>";
echo $row['Brzina_vetra'];
echo "</td><td>";
echo $row['Max_udar_vetra'];
echo "</td></tr>";
?>