As the title said there are multiple months and years displaying and they shouldn't. What I want to achieve is display one month and year from the database. For instance if there are two May 2007 in the database I want to display one May 2007. Can someone please help me achieve this result. Thanks in advance.
require "config.php";
// display the archives
$query2 = mysql_query ("SELECT * FROM tbl_articles ORDER BY STR_TO_DATE( CONCAT( day, month, year ) , '%d%M%Y')") or die ("Could not query because: ".mysql_error());
while($row2 = mysql_fetch_array($query2)){
echo "<div class=maintxt1><a href=archives.php?month=".$row2['month']."&year=".$row2['year'].">".$row2['month']." ".$row2['year']."</a></div>";
}
mysql_close();