I’m trying to build a MySQL select statement to get all data out of a MySQL table (events) for the current day that a visitor is seeing the page. However, by current day – I mean between 6AM and 5:59AM the next day. The reason being that events last till early morning the next day, I want the page to show events that are still taking place when a person views the website – at 1AM for example.
I have this code so far
SELECT * FROM events WHERE %DATE_START_SELECTED% <= start_datetime AND end_datetime < %DATE_END_SELECTED%
However I’m baffled as to how I’d set the %DATE_START_SELECTED% and %DATE_END_SELECTED% in php. Any Ideas please :)?
Thanks
use this code