Hey all!
I've created a little statistics module for the company website which also works perfectly fine ... every hit is stored in the database with the datetime format in the MySQL-database - just so I can see exactly when every visitor came to the site.
Anyway - I've listed the hits so it's split up in months - which is fine as well ... it does say:
October ... 300 visitors
November ... 12 visitors
...
But as I want to show each month more in details so it'll show hits for each day - the bug comes in play. I'm sure it's my SQL-statement that causes the problem, but if you would be so kind to see if you can help me, it would mean a lot to me.
The thing is that when I click October for example, it suddenly shows ALL entries - and replacing the actual month with the current month (which is November), so it says this:
- november, 2003 ... 17 visitors
- november, 2003 ... 5 visitors
- november, 2003 ... 8 visitors
- november, 2003 ... 5 visitors
But it shouldn't take the first 2 entries and it should say October instead of November
The link I use to enter the stats per month is this: statistics.php?stats=per_month&month=$month
($month gives "November" or "October" for example)
The SQL-statement I use is this:
SELECT DATE_FORMAT(`dato`, '%Y-%m-%d') AS `dag`, COUNT(*) AS `hits` FROM `simplecount`
GROUP BY DATE_FORMAT(`dato`, '%Y-%m-%d') ORDER BY `dato` DESC
I hope it's possible to help me with this. Thanx in advance!
/// NetRoam