I'm trying to fill a chart, however, when there is no entry, nothing will be printed. It should return a "0" when nothing exists.
I've tried to use IFNULL on my COUNT, but that does not make any difference.
SQL:
SELECT DATE_FORMAT(date(created_at), "%d. %b") AS date, IFNULL(count(*), 0) as count
FROM users
WHERE created_at BETWEEN NOW() - INTERVAL 14 DAY AND NOW()
Group by date
ORDER BY date(created_at) ASC