Not allowing a user to book if they have two bookings that day already
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!
Since you're limiting them to two entries, you're going to need some application side logic to control that.
This could be pretty simple to integrate into the user flow if you have a specific page that they need to hit when registering a reservation.
|All times are GMT. The time now is 12:30 PM.|
Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0