I am creating a tracker script for my website. I have a table in my mysql db with the following fields: page, ip, date.
Just for the record; I have no problem getting the data into the DB.
In the admin area, I want to display a list of the months where there has been traffic. The list must be dynamically generated from the data that is in my db. Then i want a link on every month so that I can click and get stats for that month only.
Example:
[url=http://#]March 2005[/url]
[url=http://#]February 2005[/url]
[url=http://#]January 2005[/url]
[url=http://#]December 2004[/url]
and so on...
How do I do this? please help...
Tnx
Date problems!!
Moderator: General Moderators
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
the months. proper selection:http://dev.mysql.com/doc/mysql/en/date- ... tions.html
You link each to a script for the actual display. This link should pass the year and month for your details selection.
Code: Select all
SELECT DISTINCT EXTRACT( YEAR_MONTH FROM `datefield` ) as `month` ....
or
SELECT DISTINCT DATE_FORMAT(`datefield`, '%M %Y') as `month` ....You link each to a script for the actual display. This link should pass the year and month for your details selection.