I currently list a bunch of events which works good using the below code further down.
The problem is, I have timestamp columns in this events table which generally show the date and time of each event. In the WHERE clause I display the events based on the CURDATE() which works well, though as soon as 12am hits, all events disappear and the next days events show.
This was good until I realised some events run til 3-5am in the morning the next day, which means nobody can see these events if visiting after 12 midnight because the next days events are already showing.
Is there a way to keep the events active until the ending timestamp has lapsed for each event. Or maybe keep all events active for that day until the last events end time has lapsed.
My current setup below:
SELECT ID , DTEND , LOCATION , DTSTAMP , DTSTART , DTSTART AS STARTMETA , SUMMARY FROM events WHERE DTSTAMP >= CURDATE() ORDER BY DTSTART ASC
DTEND has the ending time
I also tried
INTERVAL 1 DAY as shown below but this keeps all the outdated events showing for a full day, which is not what I need as all events are outdated.
WHERE DTSTAMP >= CURDATE() - INTERVAL 1 DAY
Is there a way to achieve this?