I am creating a query to pull results from a MySQL database using PHP, the results of the query are output to an Excel document.
Here is the query:
$sql = "SELECT node, port, MAX(utiltx), MAX(utilrx), time, hour(time), day(time), month(time) FROM intfstats WHERE node IN('$separated') AND year(time)=$year AND month(time)=$month AND port IN('$portsep') GROUP BY node,port,day(time);";
I think the query works ok, but it always displays the time as midnight (which is first in the timestamp column).
The aim is for the product of the query to be the maximum utilisation rx and tx by day, and the time of day that the maximum throughput occured.
I would appreciate any help on this as I have spent far too long on it with not enough knowledge of MySQL queries to pull it off!!