I would like to display the dates (month and year) of my articles from the newest to the oldest (up to down).
The problem is that when I have several articles which were written in the same month, I have several times the same date whereas I would like to display this date (month and year) only once, even if I have several records featuring this date (month and year) in my database.
Here is what I get for the moment :
Here is my PHP code :
$req_arch1 = $bdd->query('SELECT mo,yr FROM articles WHERE status="1" ORDER BY yr DESC, mo DESC');
while($req_arch2 = $req_arch1->fetch()){
echo "<p>".$req_arch2['mo']." - ".$req_arch2['yr']."</p>";
}
Thanks in advance for your answers.
Comments
Post a Comment