Statistics Question

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
baggypants303
Forum Newbie
Posts: 9
Joined: Sat Apr 01, 2006 11:04 am

Statistics Question

Post by baggypants303 »

Hey guys,

I have to build a website that needs to store statistics for Page Views, and they need to be saved and show for:

1 Today
2 Last week (starts on Sunday)
3 Last 30 days
4 Month archives
5 All time

I'll probably also have a button to reset it after end of year. Any ideas on how to do this would help me...Thanks.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

Looks like a single table would work just fine, with a little bit of clever (quite simple, actually) queries, you can perform each of those.
baggypants303
Forum Newbie
Posts: 9
Joined: Sat Apr 01, 2006 11:04 am

Post by baggypants303 »

I think I'm going to use tables yes.

However, I'm wondering how to manage the time to shift pages views (or clicks) into days, weeks, and months...

Like I can store single statistics (i.e. Total Page Views), but how to do Page Views only Today, page views by month, etc.? Just an idea about how to program something like that would be helpful.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

You wouldn't store the statistics, per se, but the individual page view recordings that would be used to create the statistics.
Post Reply