ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> php-db
php-db
[PHP-DB] Showing Average Visitors Per day
by Phil Dowson other posts by this author
Sep 28 2003 2:02AM messages near this date
Re: [PHP-DB] figures question | [PHP-DB] Selecting data from multiple tables
[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

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved