Forum Moderators: coopster
$result = mysql_query("SELECT FROM_UNIXTIME( date, '%m%y' ) AS get_year , COUNT(*) AS entries FROM news WHERE publish='Yes' GROUP BY get_year ORDER BY id DESC");while ($row = mysql_fetch_array($result)){
$get_year = $row["get_year"];
$entries = $row["entries"];
echo "<a href=\"main.php?content=archive_list&id=$get_year\">$get_year</a> ($entries)<br />";
}
This lists all my blog entries like this following:
1005 (1)
0405 (1)
0305 (12)
0205 (17)
I'd ideally like the link to stay the same, [localhost...] but have the text displayed as the actual month and year.
So it looks more like
October 2005 (1)
April 2004 (1)
March 2005 (12)
February 2005 (17)
Can anyone advise me on how to achive this?
<?php
$result = mysql_query("SELECT FROM_UNIXTIME(date, '%m%y' ) AS get_year , FROM_UNIXTIME(date, '%M %Y' ) AS get_month, COUNT(*) AS entries FROM news WHERE publish='Yes' GROUP BY get_year ORDER BY id DESC");
while ($row = mysql_fetch_array($result)){
$get_year = $row["get_year"];
$get_month = $row["get_month"];
$entries = $row["entries"];
echo "<a href=\"main.php?content=archive_list&id=$get_year\">$get_month</a> ($entries)<br />";
}
?>