views:

251

answers:

2

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

A: 

I think you should probably post the CREATE TABLE query of the table you're talking about, and a better example of the sort of results you would like to see.

TehShrike
A: 

Stick with the table layout you've got, then for the overview page select newsDate as year and month and group by that (possibly with count if you want to show how many articles there are in each month), then iterate through it for you lines. Should be fairly basic to do

Fake51