View Single Post
Old 07-14-09, 03:12 PM   #1
Tuork
Official pain in the ass
 
Tuork's Avatar
 
Join Date: May 2003
Location: 127.0.0.1
Posts: 1,197
Send a message via MSN to Tuork
Default Timetable in MySQL

I'm about to start development on a project where I need to store a timetable for a series of users. Basically, I'm talking about Tutors and Students, where I need to store the Tutor's available hours, as well as the classes they are teaching.

How can you go about storing a timetable in MySQL? I don't need the specific code, but something more like the logical idea behind it.

So far what I've come up with would be a table of "free periods", where each period would consist of a Start time/date, an End time/date and the ID of the person that has that time period free.

Similarly, "Occupied periods" could consist of Start/End times, user ID, and Student ID.

The problem I would see with this is when it comes to assigning a new class to the tutor. It would be slightly complicated to know which fields I want to modify on the "free periods" table.


I would very much appreciate any suggestions!
__________________
My avatar: "An obscure and non sensical pattern made to get people to post what they think it is" - Vamp

Dimitri:
Dell XPS M1530
Core2Duo T5550 1.86Ghz | 3GB DDR2 | 8600M GT 256MB | 250GB Hdd | BenQ FP202W 20" LCD | MX1000 mouse | Inspire T5400 5.1
Tuork is offline   Reply With Quote