I have the following problem. I have one table with a date column. I want to order my date by the date column - that is no problem, but the problem is when i print it out, the date is printed sevreal times when there are two or mor posts from the query.
The queries are:
$show_result_datum=mysql_query("SELECT FROM $agenda_table order by datum");
while($show_row_datum = mysql_fetch_array($show_result_datum))
{
echo "<h2>" . $show_row_datum[datum] . "</h2>";
$show_result_agenda=mysql_query("SELECT FROM $agenda_table where datum='$show_row_datum[datum]'");
while($show_row_agenda = mysql_fetch_array($show_result_agenda))
{
$show_row_agenda[titel] = stripslashes($show_row_agenda[titel]);
$show_row_agenda[beskrivning] = stripslashes($show_row_agenda[beskrivning]);
$show_row_agenda[beskrivning] = eregi_replace("(\r\n|\n|\r)","<br />",$show_row_agenda[beskrivning]);
echo "<p>\n" . $show_row_agenda[titel] . "<br />\n" . $show_row_agenda[beskrivning] . "</p>\n";
}
}
And the result is displayed like:
2002-12-31
766876
hkhkh
asdasd
asdasd
dasdsadsa
asdasdasd
dasdsadsa
asdasdasd
2002-12-31
766876
hkhkh
asdasd
asdasd
dasdsadsa
asdasdasd
dasdsadsa
asdasdasd
2002-12-31
766876
hkhkh
asdasd
asdasd
dasdsadsa
asdasdasd
dasdsadsa
asdasdasd
But i want the date only to print out once, what am i doing wrong here?