Ok thanks guys, helped me a lot.
Now ... I'm making a calendar. The user uploads an event with title and date (ex. 2006-07-24).
Then the title of the current month should output as a title and then the events ordered by date below.
This is my code :
$currentmonth = date("m");
<table width="100%" border="1" cellspacing="0" cellpadding="0">
$sql = mysql_query("select * from agenda where monthfield = '$currentmonth'") or die(mysql_error());
while($row = mysql_fetch_array($sql))
$event = $row["eventfield"];
$id = $row["idfield"];
$url = $row["urlfield"];
$date = $row["date"];
$month = $row["monthfield"];
echo "<tr><td><a href='$url'>$event</a></td>";
1.) I find this code kinda stupid because the user has to enter the number of the month twice. So im looking for the code that the month can be selected from the main date formfield. (2006-07
-24) and that that number can be used to output only current month events. I read that the function DATE_FORMAT has to be used?
2.) My current code does not work like it should because it still displays every month and not only the current month.