Jump to content

Months in Mysql


Mr Chris

Recommended Posts

Hi All,

 

I have a query which outputs a count of months

 

SELECT MONTH(published) as the_month, COUNT(*) AS total FROM cfm_stories 
WHERE YEAR(published) = YEAR(NOW())
GROUP BY MONTH(published)
LIMIT 1,6

 

But how do I force a column to be created with the month name.  IE at the moment Febuary's value for the_month is 2, March is 3 etc...

 

Thanks

Link to comment
https://forums.phpfreaks.com/topic/121702-months-in-mysql/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.