Hi.
I really need someone to crck this for me. This is keeping me busy for ages now and I'm really getting furstrated and fed with myself.
I need a simple solution:
I have a database with rooms. I want to have the rooms booked. So, this is fine. Now I need to do an availability check according to my date selection. So after posting the cjeckin date and the checkout date, the result page has to show the pages available.
I am going to include the crap that I have done, or rather, just the main points, but please, if you have a solution to crack this once for me, you'll save my life.
So, I've used the mysql selection like this:
$PostCheckIn = $_POST['CheckIn'];
$PostCheckOut = $_POST['CheckOut'];
mysql_select_db($database_join, $join);
$query_selection = "select * from rooms LEFT JOIN booked on rooms.RoomName = Booked.RoomName";
This is my sample sql tabase - I don't know if this is correct. I can do the coding to add a booking and display it etc etc. but I'm simply to dumb to achieve what I'd like to achieve. So, by saying this, I'm sure that my tables are quite dumb too, ;-) I mean, if I don;t know in which format and how to retrieve the booking availability, I won't know how to set-up the database. So please please crack this for me.
Ok, here is my mysql database
DROP TABLE IF EXISTS `booked`;
CREATE TABLE IF NOT EXISTS `booked` (
`bookID` int(11) NOT NULL auto_increment,
`RoomName` text,
`CheckIn` date NOT NULL default '0000-00-00',
`CheckOut` date NOT NULL default '0000-00-00',
PRIMARY KEY (`bookID`)
);
DROP TABLE IF EXISTS `rooms`;
CREATE TABLE IF NOT EXISTS `rooms` (
`roomID` int(11) NOT NULL auto_increment,
`RoomName` text,
`Desc` text,
`Rate` text,
PRIMARY KEY (`roomID`)
);
:eek::mad::mad: