Please help me read the code.

Source: Internet
Author: User
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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.