Showing Average Visitors Per day

From: Date: Sun, 28 Sep 2003 02:02:22 +0000
Subject: Showing Average Visitors Per day
Groups: php.db 
Request: Send a blank email to php-db+get-30737@lists.php.net to get a copy of this message
[I apologize if this comes through twice, the first time I sent it did not appear to go through] My problem is what I am trying to show the average number of visitors I am getting on a daily basis over a given month. So for example, I would like to be able to display the average number of visitors that came to my web site on a Monday. Included below is the table I am working with, also below there is the SQL statement I am trying to work with to produce the results. I have worked out how to show how many total visited my site on a Monday, but I cannot work out how to (a) show how many Monday's (for example) there were in a given month and therefore (b) how to turn the totals into an average. CREATE TABLE stat ( statid int(11) NOT NULL auto_increment, stat01 varchar(100) default '', stat02 varchar(100) default '', stat03 datetime default '0000-00-00 00:00:00', PRIMARY KEY (statid) ) TYPE=MyISAM; select count(weekday(stat03)) AS dayname from stat where and date_format(rms03,'%m %Y') = '09 2003' and weekday(stat03) = '0' I hope this is a simple question, I've googled for over an hour and I'm drawing blanks. Thanks! Phil Dowson

« previous php.db (#30737) next »