You are here: mysql query - 5 minutes time intervals « PHP SQL « IT news, forums, messages
mysql query - 5 minutes time intervals

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация