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
In my opinion you are better off doing this type of logic in your code. But if you wanted to do it in pure SQL you could construct a query to give you the results of all the days between one day and the next ... either by inserting into a temp table or an in memory table... then left join that into your results so that you get all the days regardless of if there were results for that day.