connect two tables in mysql
Hi all
I'm building my website in Dreamweaver.
I have create my database in localhost and it consist of 3 tables Guest , Room , Service.
Guest consist of:
ID , First Name , Second Name , Last Name , Mobile , E-mail , Age , Gender , Indentification ID , Arrival Date , Departure Date , Guest Number , Price.
Room
Room Number , Guest Room , Family Room , Businessman Room.
Service
Service ID , Meals Service , Communication Service , Mobility Service.
All I want is to connect the tables with each others so I put in the Guest table the primary key of Room (Room Number) , Service (Service ID) and I add them as INDEX in the options.
Then I start to test my website and when the explorer start it gives me the message :
Cannot add or update a child row: a foreign key constraint fails (`online hotel reservation system`.`room`, CONSTRAINT `room_ibfk_1` FOREIGN KEY (`Room Number`) REFERENCES `guest` (`Guest ID`))
I do not know what to do so please anyone help me.