jasonturner Posted March 20, 2009 Share Posted March 20, 2009 Hi I have a small holiday cottage business that im starting up, and am in the process of designing a website that will allow the customers to book online. I have created the tables for the database in MySQL and am going to use php to link the forms to the database. I believe i need a query to query the database in order to prevent double bookings . I have started a query: select gite_id, date_checkin, date_checkout(date_checkin-date_checkout)/1000000 from reservation; i need to get this query to query the database in php or something to allow the customer to identify if the cottage is booked or not. Any ideas on how i can elaborate this. Any ideas are more than appreciated Jason [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/150340-mysql-dateavailability-queries-for-booking-system/ Share on other sites More sharing options...
revraz Posted March 20, 2009 Share Posted March 20, 2009 What I did for my reservation system was plug in a value if a reservation was made for that day, instead of trying to checkin/checkout type of compare. So if they book it for 4 days, mark those 4 days as being booked, then you can check each day and see if it's available. Hope that makes sense. Quote Link to comment https://forums.phpfreaks.com/topic/150340-mysql-dateavailability-queries-for-booking-system/#findComment-789560 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.