with my current query and loop:
$sched = mysql_query("SELECT *
FROM `shows`
ORDER BY `shows`.`show_time` ASC")
or die(mysql_error());
echo "<ul>";
while($row = mysql_fetch_array($sched)){
echo "<li><a href=\"#$row[id]\">";
echo $row['title'];
echo "</li>";
}
echo "</ul>";
This works great for displaying my results like this:
- Name of show 1
- Name of show 2
- Name of show 3
However, I want to add an item to the list at the beginning of every change in day so it would display as follows:
- Monday
- Name of show 1
- Name of show 2
- Tuesday
- Name of show 3
- Wednesday
- Name of show 4
I can't quite wrap my brain around the loop needed to do this. It might be helpful to know that the field 'show_time' is a datetime type, so it has the information for both time and day of week.
Thanks.