PHP/MYSQL Year Month table for news archive
- by ee12csvt
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