I’m trying to fetch a number of rows from a MySQL database and group them by the day they were posted.
End result I would like the following..
Monday
-Article 1
-Article 2
-Article 3
Tuesday
-Article 1
-Article 2
Wednesday
-Article 1
-Article 2
-Article 3
-Article 4
And so on, I’m not sure if this can be done in MySQL alone without PHP doing extra work.
This is the query I have so far but doesn’t seem to group by day.
SELECT
cms_news.news_id,
cms_news.news_title,
cms_news.news_date,
cms_news.news_category,
cms_news.news_source,
cms_news.news_type,
cms_news.news_content
FROM
cms_news cms_news,
GROUP BY
DAYOFMONTH(FROM_UNIXTIME(cms_news.news_date))
ORDER BY
cms_news.news_date DESC
Thanks.

0