I have this query:
SELECT COUNT(*) as clicks, DATE_FORMAT(FROM_UNIXTIME(click_date), \'%w %M %Y\') as point FROM tracking WHERE click_date < $end_date A
I'd stick to PHP logic, looping between the lowest date and the highest date, and incrementing one day at a time.
You could probably do it in SQL with some fancy joins, but I won't even start to consider that nastiness!
BTW, %w is the day of the week, starting 0=Sunday. You probably wanted %d.
%w
%d