In my website on trip planner,I want that user can check if room is available or not...b/w particular dates..
how can i do this?
also..how shud i create the database..??as in what atrributes shud i use?
Well for your database you can create a table called tblRooms, which contains the following fields:
- room_id (primary key)
- room_name (varchar)
- room_features (string/text ?!?)
- is_booked (boolean)
- date_booked (date)
- duration_booked (integer => num of days)
Now to check if the room is available between certain dates, you search for the range of dates from (date_booked) to the (date_booked + duration_booked) date.
I also think, you should have a table tblBookings, to store all of your bookings. This table must also have the foreign key room_id from the tblRooms.
The design, is not so perfect as i can perceive other things already, but it should give you an idea of the course to take.