Grouping database output

Hi,

I run a school newspaper and I am trying to create a databased archive
of our previous news stories. Each story has a dateline field in the
table (ex: 2007-06-04). What I'm trying to do is query the database
and then group all the stories by month. So I'd have an array of
years, months, and then stories. Does anyone know an easy way to do
this?

Thanks!

Ryan
ryan.m.powers [ Di, 03 Juli 2007 02:58 ] [ ID #1758694 ]

Re: Grouping database output

On 3 Jul, 01:58, ryan.m.pow... [at] gmail.com wrote:
> Hi,
>
> I run a school newspaper and I am trying to create a databased archive
> of our previous news stories. Each story has a dateline field in the
> table (ex: 2007-06-04). What I'm trying to do is query the database
> and then group all the stories by month. So I'd have an array of
> years, months, and then stories. Does anyone know an easy way to do
> this?
>
> Thanks!
>
> Ryan

I did a google search of the newsgroups for the words
group by month
and found a plethoria of replies on this very topic, including one of
my own recent ones.

http://groups.google.co.uk/group/comp.databases.mysql/browse _frm/thread/726ff96947f164e8/8e9ad033a5129e0e?lnk=gst&q=grou p+by+month&rnum=1#8e9ad033a5129e0e
Captain Paralytic [ Di, 03 Juli 2007 11:12 ] [ ID #1758695 ]
PHP » alt.php.sql » Grouping database output

Vorheriges Thema: Field storage
Nächstes Thema: Resource to learn code and share code and knowledge