SELECT from_unixtime( cdb_posts.dateline, '%Y-%m-%d' ) AS date1, cdb_forums.name, count( cdb_forums.fid ) AS threadcount
FROM `cdb_forums` , `cdb_posts`
WHERE cdb_forums.fid = cdb_posts.fid
GROUP BY from_unixtime( cdb_posts.dateline, '%Y-%m-%d' ) , cdb_forums.name
ORDER BY date1 DESC