Allways get next upcoming event!?
Posted: Fri Mar 23, 2007 2:53 am
How can I allways only get the next comming date/event from my calender.
Lets say that today is 23-3-07 and the next event is 27-3-07. Right now it prints only the first event in my calendar but I want to show the next coming event from the db when the date from the first has surpassed!
I tryid this but with no luck... Where is my error? Can anybody please help...
Lets say that today is 23-3-07 and the next event is 27-3-07. Right now it prints only the first event in my calendar but I want to show the next coming event from the db when the date from the first has surpassed!
Code: Select all
$query="SELECT *, DATE_FORMAT(date, '%d-%m%-%Y') AS date FROM calendar WHERE date > NOW() LIMIT 1";
/*$query="SELECT * FROM calendar";*/
$result=mysql_query($query);
$calendar = mysql_fetch_array($result);