Forum Moderators: coopster
I am trying to decide what kind of logic to use in my approach.
Would I want to create all the tables and rows ahead of time as far out as I can, say 10+ years? That could be alot of work.
Is there a way to auto generate tables or rows as time goes on?
Does anyone have any suggestions to what may be the best approach?
Essentially there would be 24 slots per day that were available for sign up. Would this need to be ongoing or just a few months out at a time?
Empty slots (hours of a given day that are not booked, and therefore not present in the DB) are handled using PHP, being available for booking etc...
Hope that helps..
From your original post I think you may have been thinking about creating a table for every day/month. This (as you say) would be a nightmare to keep on top of, not to mention massively inefficient.
By using a single table to store the times and dates of booked slots you will save a lot of work in the long term. Always make the script/database do the hardwork! ;)
When you come to book a time, you would have to run a query on the bookings table to select all of the rows where the date the user wishes to book matches a date you have selected and then use some PHP to work out which times are free based on the times already booked for that day (retrived in your select query).
[edited by: Sagaris at 3:59 pm (utc) on July 31, 2007]
Now what about showing a month at a time or just todays date + 2 weeks? How would I set it up for them to look ahead, or should it be locked at only 2 weeks out?