Jump to content

Recommended Posts

$query = mysql_query("SELECT * FROM av_items  ORDER BY av_items.date DESC LIMIT 20");

	while ($row = mysql_fetch_assoc($query)) {
		$id = $row['id'];
		$date = $row['date'];
$message = $row['message'];

		$entry_date = date("Ymd", $date);
		if ($entry_date !== $called_date) {



		echo '<h1 class="topic">'.av_date($date) .'</h1>';
echo $message;
$called_date=$entry_date;
}
}

 

Have you tried this? :

 

$query = mysql_query("SELECT * FROM av_items  GROUP BY month(date) ORDER BY av_items.date DESC LIMIT 20");

	while ($row = mysql_fetch_assoc($query)) {
		$id = $row['id'];
		$date = $row['date'];
$message = $row['message'];

		$entry_date = date("Ymd", $date);
		if ($entry_date !== $called_date) {



		echo '<h1 class="topic">'.av_date($date) .'</h1>';
echo $message;
$called_date=$entry_date;
}
}

try

$query = mysql_query("SELECT * FROM av_items  ORDER BY av_items.date DESC LIMIT 20"); //remove GROUP BY part

	while ($row = mysql_fetch_assoc($query)) {
		$id = $row['id'];
		$date = $row['date'];
                                          $message = $row['message'];

		$entry_date = date("Ymd", $date);
		if ($entry_date !== $called_date) {



		echo '<h1 class="topic">'.av_date($date) .'</h1>';
//echo $message;
$called_date=$entry_date;
}echo $message, "<br />\n";
}

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.