Just starting to experiment with php and mysql but I know very little about either. I'm not asking for someone to do the work for me just some guidance in the right direction.
Basically I have a mysql database which is populated automatically every 60 seconds with current air temperature, set temperature, date/time, events etc. and what I want to do is have my web page display the latest information available.
There are 5 tables for various different things. they are comfort, events, temperatures, settings and timer.
In the tables I am interested in (events and temperatures) I have fields for time, class, and status in events and time, airtemp, settemp and comfort in temperatures.
I have managed to have it fetch the "latest" airtemp and settemp however not sure if I have done this the long way by first doing a SELECT max(time) FROM temperatures, setting that as $maxtime and then doing a SELECT airtemp FROM temperatures WHERE time=$maxtime. Is this a long winded way to achieve this?
My other problem is i want to find the latest of a certain class in events and report its status but cant get anything to work to achieve that.
Any help or advice would be very much appreciated.