praethorian Posted November 20, 2008 Share Posted November 20, 2008 <?php @$result = mysql_query("SELECT MONTHNAME(FROM_UNIXTIME(date)) FROM ".TBL_NAME." ORDER BY date DESC") or die("Wrong query: " . mysql_error()); $total = mysql_num_rows($result); if($total>0){ for($i = 0; $i < $total; $i++){ $row = mysql_fetch_array($result); ?><a href="blog.php?month=<?php echo $row[0]; ?>" ><?php echo $row[0]; ?></a><br/><?php }//for } ?> OUTPUT IS: November November October October October September Anybody knows how get rid of the month name duplicity? Just to print: November October September THX Link to comment https://forums.phpfreaks.com/topic/133494-array_unique-from-db/ Share on other sites More sharing options...
Mchl Posted November 20, 2008 Share Posted November 20, 2008 SELECT DISTINCT MONTHNAME(.... Link to comment https://forums.phpfreaks.com/topic/133494-array_unique-from-db/#findComment-694299 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.