Posted by Robbo on 07/05/06 09:59
I have a table where I log activities on the website. Each page retrieval is
being logged to this table. I have the IP address and the timestamp when the
page was retrieved.
I assume that the number of people currently on site users is being
calculated as :
<? $current_time= date( "YmdHis", time() ); ?>
$results = mysql_query("SELECT ip FROM logg WHERE
retrieved_time>DATE_SUB($current_time,INTERVAL 5 MINUTE) GROUP by ip;");
$users_on_site = mysql_num_rows ($results);
So it tells me how many users are currently viewing the site (assuming that
each visitor stays 5 minutes on site).
Now I would like to perform a query that would check in the past when was
the time that there were more than 5 or e.g 10 users on the site(assuming
that visitors within 5 minutes interval are known as "currently viewing the
page").
Or a query that shows results sorted by max_current_users with dates.
Any advice?
--
rb
[Back to original message]
|