Forum Moderators: coopster
January
- January 3, 2006
- January 12, 2006
March
- March 8, 2006
- March 29, 2006
December
- December 31, 2006
I do not want to list any months that do not have dates listed with them. I'm still learning php and have been racking my brain for the last two days trying to figure out how to do this, so any help will be appreciated.
Jennifer
$sql = "SELECT MONTH(mydate) AS mymonth, mydate FROM table ORDER BY mymonth, mydate";
$rows = mysql_query($sql);
$month = false; // initialize
while ($row = mysql_fetch_array($rows)) {
if ($month !== $row['mymonth']) {
print "$mymonth<br />";
}
print " {$row['mydate']}";
}
Jennifer