Please help me read the code! HTMLcode & lt ;! DOCTYPEhtmlPUBLIC & quot;-// W3C // DTDHTML4.01Transitional // EN & quot; http://www.w3.org/TR/html4/loose.dtd ask experts to help read the code!
HTML code
Hospital outpatient registration system
Enter complete patient information!
Query ($ query); if (! $ Result) {echo "login failed! "; Exit;} echo"Registration successful!
"; $ Db-> close ();?> Continue registration
I use the name Guahao. the php file accepts data from the form and inserts records into mysql. However, the return value of the query statement is false every time. I am depressed. I have tried countless methods. Please help me see where the problem is!
------ Solution --------------------
If (! $ Result)
{
Echo $ db-> error;
Echo "cannot log on! ";
Exit;
}
------ Solution --------------------
Discussion
If (! $ Result)
{
Echo $ db-> error;
Echo "cannot log on! ";
Exit;
}
------ Solution --------------------
You cannot add or update a child row: a foreign key constraint fails.
Your SQL statement?
------ Solution --------------------
Run the following command line:
Alter table guahao drop foreign key guahao_ibfk_1;
Run the following command:
Alter table guahao add foreign key (room) references 'Room' ('name') on delete cascade on update cascade;
Try this way.