I'm using Xampp phpmyadmin for the first time...

So I've got the basics of the database. Customers, hotels, rooms etc. The customer can chose a check-in and check-out date. An admin can class a date as available/not.

My question, is how would I get the database to automatically update the dates as unavailable?

When I've tried, it makes that date unavailable for every room in every hotel.

(Still a newbie at all this, so sorry if this doesn't make any sense!)

Attached a rough draught of my ERD for reference.ERD

2 Answers 2


I started making a comment but noted that it would be too long. I'm not sure what parts of your ERD are given, and what parts you have created. Anyhow, here are some reflections

A room exists in a hotel, no? Assume your hotel H1 have 10 rooms and hotel H2 have 20 rooms. What prevents someone from booking room 11 in H1?

I don't understand your entity for availibility. If there are no bookings, nothing is availible? I would say that availibility is defined as (All dates x All rooms) - Bookings. Question is, do you need to store this somewhere, or can you derive it?


as a starting point

try to disconnect hotels from booking and instead connect it to rooms so you can reserve room that belong to an hotel

then i suggest to manage availability on room with reservations marked as unavailable

then remove booking id from customers

in the booking table you have to mange reservation as period not as single date so you need date_start, date_end...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.