I am trying to make a script which shows upcoming event (single one).
Here is what I have:
Joomla, an extension where you can add an event and a calendar of that extension that shows those events on it. Events are stored in MySQL (date of event is stored xxx-xx-xx format).
To show an event till date I am thinking this:
<?php if(strtotime('gets date from mysql') > time()): ?>
And I face an issue here. How to tell a script what event to pick automaticaly, and after deadline to pick another, nearest event?
To find an event I think it has to search from this day and find the first one after today’s date.
(edit: maybe it is better to use SELECT * FROM ... WHERE 'time' > NOW() ORDER BY 'time' ASC LIMIT 1 instead of strtotime?)
Thank you!
Regards,
Baseckas
You need a query like this to return your upcoming event: