Next class / event plugin


This isn't anything to do with any of the WPMU DEV plugins, so not sure if it's ok to ask for help on this, but I need to display the 'next yoga class' that is coming up on a homepage of a site.

Details of all the classes are stored in MYSQL and each of them are recurring weekly, so as an example a class on a Monday evening at 6pm will be like that every week. To make matters more complicated there are two classes each day - so any checking in the code needs to include the time also.

Current DB Structure-
TITLE: Basic Class
DAY: Monday
TIME: 6pm
DURATION: 75mins
VENUE: Venue

I need to return the next class/event based on the current server time/day. It seems to be easy if based on a 'date' but as they are recurring weekly I need to base it on 'days'. Any suggestions?

Many thanks