>= NOW() problem???!
Posted: Sun Apr 01, 2007 9:53 am
I'm trying to make an event calendar where I want 2 show only the next upcoming event. I allmost got it to work but I have 2 problems!
1. By using the script below I got it to show the next coming event, but i changes on the date of the event, and I want it to change on the first day after the event date. Ex. If I have a event the 5 of march 2007 and the next event is the 8 of march I want to be able to show the 5 of march event also on the 5 of march and then it changes to the next event on the 6 of march!
2. In my db the dates are inserted as this: 2007-04-05. That means that the above script doesn't regonize the date and list them by "id". So if I create a new event later on but the date is in between to other events, the script doesn't show the right next upcomming event by date but by "id".
I think the main problem is in issue 2, but I can't figure this out!
Hope the help is not far away. THANX!
1. By using the script below I got it to show the next coming event, but i changes on the date of the event, and I want it to change on the first day after the event date. Ex. If I have a event the 5 of march 2007 and the next event is the 8 of march I want to be able to show the 5 of march event also on the 5 of march and then it changes to the next event on the 6 of march!
Code: Select all
$query="SELECT *, DATE_FORMAT(event_date_start, '%d-%m%-%Y') AS date FROM calendar WHERE event_date_start >= NOW() LIMIT 1";I think the main problem is in issue 2, but I can't figure this out!
Hope the help is not far away. THANX!