I'm working on a sports website and ran into an issue. There is more than one game on different days and I'm only wanting the date to display once instead of once for every game to be played on that date.
For example: http://seohiosports.com/mastergirlsbasketballschedule2014.php You will see immediately that there are two games listed on November 26. They are displayed like this:
November 26, 2013 Tri-Valley at Crooksville November 26, 2013 Sheridan at John Glenn
I want it to be displayed like this:
November 26, 2013 Tri-Valley at Crooksville Sheridan at John Glenn
Here is the code I'm working with, for some reason or another, I'm struggling to come up with the test/loop I need to make this work how I want it to.
if($num > 0)
{
while($row = mysql_fetch_array($r, MYSQLI_ASSOC))
{
echo '<b>'. date("F d, Y",strtotime($row['date'])) .' </b><br/>
'. $row['awayteam'] . ' '. $row['awayscore'] .' at '. $row['hometeam'] . ' '. $row['homescore'] .' <br/><br/>';
}
mysql_free_result($r);
}
Thanks in advance for any help. I think the answer is probably simple, but I'm struggling for one reason or another.
Thanks!