I have this db table named log and in this i have two fields id and time. Id is primary key (AUTO_INCREMENT) and time is stored as input time, time();
So my question is, how can I count records per day?
I'm trying with this but I can't seam to get it to work:
SELECT count(id) AS count, (date(time)) AS thedate
FROM log
GROUP BY thedate
ORDER BY thedate ASC
And is shows up like this:
Date-Count
empty_date-35
2012-03-07-1
The table has a totale of 35 records and they are submitted over the past 2 moth so all of the shouldn't be grouped together!
Anyone who think they know what the problem is?