Click here to Skip to main content
15,920,031 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
Hello guys. I got really stucked on one thing. I am actually developing an online website booking for a small accommodation. I have a problem. i need the sql code to display the rooms available.
here is the scenario:
we are on the home page. the user select the checkin and checkout date and then he clic search for the room available. I want to load the available rooms in another page.
Any help would be the welcome

here are my tables

reservation table:
reservId
clientId
employeeId
roomNumb
dateIn
dateOut

room table:
roomNumb
roomtypeID
roomRate
floor

roomtype table
roomtypeId
roomType
numberOfPersons
Posted
Comments
Legor 28-Aug-12 9:38am    
So where are you stuck at the moment? Nobody here will provide you the code for doing this.

1 solution

So... if the room availability is determined by numberOfPersons, then you should use that field to discriminate the registers and to show only the ones that accomplish a specific rule on that field...

Then reagrding how to select some values in a database, you should see How to use select clause[^].

And how to specify a condition[^] for the select clause.

Once you've done that you will get the result you are after.

Then you'll have to store that result into a recordset in order to work with it.

Try it and come back with details.

Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900