Request help reporting date-time statistics

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
fpearl
Forum Newbie
Posts: 1
Joined: Mon Feb 21, 2011 9:57 pm

Request help reporting date-time statistics

Post by fpearl »

Hi there,

I am working on an app that reports date and time statistics. A mysql table stores each login with a unix timestamp. Setting aside the question of timezones (which I think I can handle), I want to get the following statistics in an expedient fashion:

number of logins today
number of logins this week
number of logins this month
average number of logins per day
a list of the last 25 visitors

I know how to query for each of the above statistics. What I am trying to do is accomplish it without making 3 or 5 queries. Is there a more efficient way?

Fred
Post Reply