View Single Post
Old 07-02-2010, 12:08 PM   #1 (permalink)
rix1505
The Wanderer
 
Join Date: Oct 2009
Posts: 6
Thanks: 1
rix1505 is on a distinguished road
Default Not allowing a user to book if they have two bookings that day already

Hi folks!

OK I have got on pretty well with little php / mysql project for a Water Ski Tow booking system

I'm nearly done, just one thing I'm puzzled with.

Members can log in and look at a list of ski two booking slots, and book a slot that is available. What I want to do, is once a member has booked two slots that day, is prevent them from booking anymore.

So, my database table is called bookings and it contains

ID (primary key, auto increment)
skidate (date of the slot, e.g. 03 July 2010)
skitime (time of the slot e.g. 09:10)
status (available, booked, or blocked)
member_ID (the username of the person if it's booked)

Do I check the table when a user tries to book a third slot that day, using some method in my insert script, or do I somehow not list records for days where a member has already booked 2 slots, and how would I do either of these?

Thanks in advance!

Rich :)
rix1505 is offline  
Reply With Quote