Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grouping by date...

Status
Not open for further replies.

dodgyone

Technical User
Jan 26, 2001
431
GB
I have a field in MySQL that contains the date. I have ordered the sql query into date order ascending.

What I would like to do is when displaying the records is to distinguish that the same date has ended and new date has begun. This is so that I can put each date series into a box (table with a border).

So that each day in the week is displayed with a box around it.


Any ideas?

Thanks...

 
what about checking the previous and the current displayed date?
$prevdate = '1900-01-01';
while ($row = mysql_fetch_array($result)) {
if ($prevadate!=$row['datecolumn']) {
//end table and start new one
} else {
//add new line
}
$prevdate = $row['datecolumn']
}

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top