The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!
$aRows = $dbase->select('e.image_path, e.time_stamp, e.start_time, e.end_time, e.location, e.event_id, e.title, e.server_id, '.Phpfox::getUserField())
->from(Phpfox::getT('event'),'e')
->join(Phpfox::getT('user'),'u','u.user_id = e.user_id')
->where('e.start_time <= '.(PHPFOX_TIME).' AND e.end_time >= '.(PHPFOX_TIME))
->limit(4)
->order('e.time_stamp DESC')
->execute('getRows');
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
In your WHERE clause you can use IN to test for the events, like
WHERE event IN (1, 5, 7)
As for displaying events "15 before the start time" first, 15 what -- seconds minutes hours days? And second what are we comparing the start time to (the current date/time? Some as-of date?)
You can do
WHERE start_date - INTERVAL 15 MINUTE >= Your_DateTime AND end_date <= Your_DateTime
or something along those lines, or use the DATE_ADD() function similarly like
WHERE DATE_ADD(start_date, INTERVAL 15 MINUTE) >= Your_DateTime