PDA

Click to See Complete Forum and Search --> : listing events under dates ?


richsmith
Aug 31st, 2005, 04:08 AM
hello, i have some php which takes some news items out of a sql database and lists them in date order, however i would like to make it so it lists them under the date eg: 30th aug - news 1, news 2 29th aug - news 1 etc.
im not sure how to do it.
thanks

richsmith
Sep 1st, 2005, 02:39 AM
does anyone know?

Pc_Madness
Sep 1st, 2005, 05:06 AM
Datie()? I think you mean date($row[6]) :p

Just have a variable hold the current date, and just do a check if the current date <> old date in variable, if it is, print a row (the "August 1st" one in the example below), assign the current date to the variable.

(I'm assuming you mean it would appear like this,
------August 1st------
News Item One
News Item 2
------August 3rd-----
News Item 3
News Item 4)