PHP/MYSQL Year Month table for news archive

Posted by ee12csvt on Stack Overflow See other posts from Stack Overflow or by ee12csvt
Published on 2010-03-19T23:02:57Z Indexed on 2010/03/19 23:11 UTC
Read the original article Hit count: 282

Filed under:
|
|
|

Hi all,

I am creating a news archive for my site and want to create an overview page from the following DB table

id - Unique identifier newsDate - in a format XXXX-XX-XX title - News Item title details - News item photo - News Item Photo caption - News Item Photo caption update - Timestamp for record

The news on the site is current but I hope to add some data from years gone by over the next few months and years.

What I want to do is create a new line for each year and highlight the month which corresponds to a record in the DB table, similar to that below.

2002 JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC 2004 JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC 2005 JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC 2008 JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC

Any help or advice would be much appreciated

Cheers

© Stack Overflow or respective owner

Related posts about php

Related posts about mysql