I have a large database that I am querying. There are multiple results that share the same "Date". SO, I might have 5 results today and 8 results yesterday and so on.
I echo the result so that each article has the "date" below the title right now. But, I am searching how to show the DATE HEADER and then the article headlines below each date that is grouped.
SO:
September 19, 2016
- Article 1 Title
- Article 2 Title
- Article 3 Title
- Article 4 Title
September 17, 2016
- Article 1_1 Title
- Article 2_1 Title
- Article 3_1 Title
... so on.
Here is a snapshot of my MYSQL. Thanks super mucho in advanced NINJAS!!
Code is below:
<?php do { ?>
<b><?php echo date('M. j, Y', ($row_Recordset2['date'])); ?></b><br />
<b><a href="/full.php?id=<?php echo $row_Recordset2['id']; ?>"><?php echo stripslashes(htmlspecialchars($row_Recordset2['title'])); ?></a></b><br />
<?php echo (stripslashes(str_replace("{nl}", "<br />", $row_Recordset2['short']))); ?>
<?php } while ($row_Recordset2 = mysql_fetch_assoc($Recordset2)); ?>