What kind of structure will I need? (php/mysql)

Associate
Joined
26 Jun 2003
Posts
1,140
Location
North West
Im creating site for someone and they want a hit counter that has this information:

60 visits (today)
57 visits (yesterday)
476 visits (month)
2244 visits total

What kind of table structure will I need and what PHP stuff will I need to do to work this out?

Not got my thinkin hat on today.

Thx for your help.
JD
 
I thought about that but the site has had over 5000 hits in about 5 days. In a years time this could easily be in the 500000+ figure mark?

So is it the best way to store each hit coz the table could get potentially large?

I was thinkin like:

table: hits
totalhits
dayhits
weekhits
monthhits

but how can i calculate when to reset each week/month/day etc?

jd
 
Last edited:
Heheheh

ok point made chaps. Thx.

So what queries can work out how many hits today, this week and this month?
 
Yeh I understand that its how I calculate the start date of the queries?

now() - start of month, start of week etc.

jd
 
Back
Top Bottom