If I would change
SELECT * FROM
SELECT visits, visitors, hit, MIN(visitors) as minvisitors, MAX(visits) as maxvisits FROM
it will ofcourse return one row as MIN and MAX are aggregate functions.
I could also do a foreach loop with PHP ofcourse, making the query easier and maybe the script less heavy for the database? Is that a better idea? If so, then I would only need to know how to select the past 30 minutes/12 hours.
The final result would be presented in a (HTML) table like this;
2013-12-01 12 visitors 24 visits
2013-11-30 <font color='"#FF0000"'>11 visitors</font> 20 visits
2013-11-29 22 visitors <font color='"#00FF00"'>34 visits</font>
2013-11-28 14 visitors 20 visits
I will also like to add two AVG functions so you have the average number of visitors/visits. This can also be done in PHP, but what do you think?
Thanks for any help