Horrid
Programmer
- May 20, 1999
- 373
I am trying to get the count of all entries per day for 14 days. Days where there are 0 results I want to return as 0. My current SQL that gets the data I need but only for the days with data:
select COUNT(ID), DATE_FORMAT( madeTime, '%Y%m%d') from test where topicID=X group by DATE_FORMAT( madeTime,'%Y%m%d') LIMIT 14;
I want to avoid a combined php/mysql solution and just have mysql give me all days. Any hints?
Thanks
select COUNT(ID), DATE_FORMAT( madeTime, '%Y%m%d') from test where topicID=X group by DATE_FORMAT( madeTime,'%Y%m%d') LIMIT 14;
I want to avoid a combined php/mysql solution and just have mysql give me all days. Any hints?
Thanks