Hi guys,
I am trying to echo multiple calendar events from a mysql table and order them by the date column.
There are several events on each day so I am trying to echo the date once then list the associated events under that date.
Such as
2014-05-10
Event 1, event 2, event 3
2014-05-11
Event 1, event 2, event 3
instead of
2014-05-10 event 1,
2014-05-10 event 2,
2014-05-10 event 3,
2014-05-11 event 1 etc...
This is my coding so far:
while($row = mysqli_fetch_assoc($result)) {
$dutydate = $row['MyDate'];
if($dutydate != $previousdate) {
echo $dutydate.'<br />';
}
elseif(!empty($dutydate)) {
echo $dutydate.'<br />';
}
echo $event1.' | '.$event2.' | '.$event3.'<br />';
$previousdate = $dutydate;
}
?>