Ok so here's the problem, I'm building a query that will output data obv heh. Here's my layout and my idea.
Each table has a common id that being "machine" field. So that much is good.
Table Hard Drive
id---------machine--------available---------total---------datetime
Table Memory
id---------machine--------available---------total----------datetime
Table Load
id---------machine---------5avg---------10avg---------datetime
We have a script that updates these every 10 minutes , hence forth the datetime function in each table.
What I had planned on doing was a multi table select and then output them for each one and have them go that way. We have 10 machines so what I would want the output to look like would be.
Output Sample::
Machine: Fred
HDD Avail: 50 GB
HDD Total: 120 GB
Memory Avail: 45 MB
Memory Total: 120 MB
0AVG: .95
5AVG: 22
15AVG: 9.6
Machine: Joe
etc etc etc
I thought about having it do a for loop and to increment the machine number so it would cover all the machines, but my question is how do I get it to pull the latest one from the datetime function at the same time.
My original idea was to have a select that ordered by datetime desc and then limited to one but that wont help with the output and would have to have me make 12 diff queries. I know theres an easier way but would like some input please. thanks
T