I'm trying to create a database for a hotel company with multiple hotels. I'm stuck on how to reserve a room? 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.
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?