# How to query reservation db for availability?

**URL:** <https://forum.kirupa.com/t/how-to-query-reservation-db-for-availability/89778>\
**Category:** Uncategorized\
**Created:** [May 11, 2005, 2:56pm UTC](https://forum.kirupa.com/t/how-to-query-reservation-db-for-availability/89778 "2005-05-11T14:56:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![prada](https://avatars.discourse-cdn.com/v4/letter/p/3d9bf3/32.png) [@prada](https://forum.kirupa.com/u/prada)\
**Post date:** [May 11, 2005, 2:56pm UTC](https://forum.kirupa.com/t/how-to-query-reservation-db-for-availability/89778/1 "2005-05-11T14:56:44Z")

</div>

HI there  
REALLY hope someone can help.  
I am trying to make a little hotel reservation system (using flash, PHP and mySQL) and am really confused as to how I can represent accurately the calendar year and how to query the database to check (1)availability of rooms for a particular time period (2)available rooms & booked rooms for particular month.

I already have 3 tables : bookings, room & clients.  
Table called clients contains info on the guest like ID, address etc.  
Table called room contains details of a room like roomID etc.  
Table called bookings contains details like roomID, clientID, startDate, endDate

Do i have to create tables for each month in a given year recording the rooms status? e.g. tables called May Rooms, June Rooms?

Do i have to hard code the exact amount of days in each month for any given year?

I just am really confused about querying the database ☹

Any help would be soooooooo appreciated
