Creating appointments system

Hello,

I am creating two appointments systems and I can’t seem to get a hang of one aspect for each.

if there are set times for appointments of 30 mins each, eg 0900, 0930 1230 1400, 1630, need I have a table that contains all possible appointment slots? Just seems a bit excessive when many of them won’t actually be booked.

The second booking system has no set appointment times. You can ‘book’ for any time between 0930 and 1630 (except 1200 - 1300), and the only restriction is that no more than 50 people are ‘in’ at the same time.

If anyone can give me a nudge on either question, it would help me greatly.

bazz

if there are set times for appointments of 30 mins each, eg 0900, 0930 1230 1400, 1630, need I have a table that contains all possible appointment slots? Just seems a bit excessive when many of them won’t actually be booked.

On this question. I think it makes more sense to assign a time on the appointment and control the logic of availability with PHP or other language.
In other words:
appointment- john doe, 2010-12-50-05 08:00:00, 2010-12-50-05 08:30:00
Use another query to look for availabilty-
“SELECT * WHERE start_time>=$start_time AND end_time<=$end_time”
The selection of an appointment would be controlled through a form which could be dynamically created as needed.

The second booking system has no set appointment times. You can ‘book’ for any time between 0930 and 1630 (except 1200 - 1300), and the only restriction is that no more than 50 people are ‘in’ at the same time.

Again use a query to validate sign ups:
“SELECT count(*) WHERE start_time>=$start_time AND end_time<=$end_time”

Thanks.

I already understood that but, you have jigged my brain and the penny seems finally, to have dropped. I need to store the other constraints in their own table.

bazz