Re: Grouping timestamps by day...
| From: | Andrew Brampton | Date: | Wed, 07 Aug 2002 18:53:30 +0000 |
| Subject: | Re: Grouping timestamps by day... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-111563@lists.php.net to get a copy of this message | ||
VERY VERY rough guess, but something like
SELECT COUNT(*) AS vistors, TO_DAYS(timestamp) AS date FROM table GROUP BY
TO_DAYS(timestamp)
I think something like that might work, the only problem is that will show
hits, NOT unique visits, if you want to show unique visits, then you will
have to do some addiation SQL, something like:
SELECT COUNT(DISTINCT ipaddress) AS vistors, TO_DAYS(timestamp) AS date FROM
table GROUP BY TO_DAYS(timestamp)
Unsure if any of this will work, since I just looked all the commands up in
the MySQL manual :), but its worth a try
Andrew
----- Original Message -----
From: "Jeff Lewis" <jeff@hyrum.net>
To: <php-general@lists.php.net>
Sent: Wednesday, August 07, 2002 7:38 PM
Subject: [PHP] Grouping timestamps by day...
I have a table of values that look like this:
timestamp | ipaddress | referer | useragent
I want to set up a link so that when i click on it, it will break it down
like so:
August 7, 2002 - X visitors
August 6, 2002 - X visitors
August 5, 2002 - X visitors
etc.
How can I do this with the values stored as Unix timestamps? Any help would
be greatly appreciated.
Jeff