how would i go about setting in the bottom loop for getting each year in the database from the timestamps and looping though each month of the year
eg.
2005 dec
2006 jan
2006 feb
etc…
i would also possibly like to have it only start from the first month a date was entered but it may require more work than its worth
[code=php]
//knowj blog
//08/08/06
//multipage display
//define the months matching there numeric order
$month[1] = “January”;
$month[2] = “February”;
$month[3] = “March”;
$month[4] = “April”;
$month[5] = “May”;
$month[6] = “June”;
$month[7] = “July”;
$month[8] = “August”;
$month[9] = “September”;
$month[10] = “October”;
$month[11] = “November”;
$month[12] = “December”;
//set current date into an array in numeric form
$date[day] = date(dmy);
$date[month] = date(m);
$date[year] = date(Y);
$query = “SELECT DATE_FORMAT(`blog_date`, ‘%Y’) FROM `kj_blog` ORDER BY `id` DESC”;
$result = mysql_query($query) or die(mysql_error());
$i = 1;
echo “<ul>”;
while ($row = mysql_fetch_assoc($result))
{
while ($i<=$date[month])
{
//here i want to have for each year in the database echo every month with year into a list
echo ‘<li><a href=”?id=1&bmonth=’.$i.’&byear=’.$row[year].'”>’ .$month[$i].’ ‘.$date[year].'</a></li>’;
$i++;
}
}
echo “</ul>”;