MySQL query to select total registries per month and year
SELECT monthname(created_at) as month, year(created_at) as year, count(*) published FROM posts GROUP BY year, month ORDER BY min(created_at) desc