Nieuw lid |
|
ach stom sorry had ik niet gevonden thnx^^
edit:
Ik kom er alsnog niet uit, mijn script:
<?php
$sql[0] = "SELECT datetime,DATE_FORMAT(datetime,'%Y') AS jaar FROM nieuws GROUP BY datetime";
$result[0] = mysql_query($sql[0]) OR die(mysql_error());
while($array[0] = mysql_fetch_array($result[0])){
$date = $array[0]['jaar'];
echo $date ."<br />\n";
$sql[1] = "SELECT datetime,DATE_FORMAT(datetime,'%m') AS maand FROM nieuws WHERE datetime='$date'";
$result[1] = mysql_query($sql[1]) OR die(mysql_error());
while($array[1] = mysql_fetch_array($result[1])){
echo "-". $array[1]['maand'];
}
echo "<br />\n";
}
?>
<?php $sql[0] = "SELECT datetime,DATE_FORMAT(datetime,'%Y') AS jaar FROM nieuws GROUP BY datetime"; $date = $array[0]['jaar']; $sql[1] = "SELECT datetime,DATE_FORMAT(datetime,'%m') AS maand FROM nieuws WHERE datetime='$date'"; echo "-". $array[1]['maand']; } } ?>
resultaat:
2005
2006
Zonder maanden dus.. Wat doe ik fout? |