php - sorting database result object (array) according to months -
i have database has newsletter entries want arrange according months. db has following fields id, title, description , date. date has full date e.g. 2007-02-01 15:26:02. want arrange newsletters according corresponding month e.g want have this
november 2010
title of newsletter
title of newsletter
... till title of november 2010 newsletters printed out
december 2010
title of newsletter
... till title of november 2010 newsletters printed out
and on.
please me code achieve or give me idea on how go it.
select * db order month(date) 'd' desc group month(date)
this query looking for, rest pretty basic php/sql should able guide or , apply it.
Comments
Post a Comment