if (mysql_num_rows($result) > 0) { while($row = mysql_fetch_assoc($result)) { $date = $row['date']; list($day, $month, $year) = split('[/.-]', $date); //echo "Date from database ="; //echo $row["date"]; //echo '
'; //echo "Date after format ="; //echo $year ; //echo '
'; if ($lastYear !== $year) { echo ""; echo '
'; echo '
'; echo '
'; echo '
'; echo "

".$year."

"; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; } if ($lastMonth !== $month) { echo ""; echo '
'; echo '
'; echo '
'; echo '
'; echo "

".$months[(int) $month]."

"; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo ""; echo ""; } $lastMonth = $month; $lastYear = $year; echo $row["articleTitle"]; echo '
'; echo $row["date"]; } } else echo 'No articles have been selected for viewing'; // free result set memory mysql_free_result($result); // close connection mysql_close($connection); ?>
TitleAuthorCategoryDate SubmittedView