Let's see if there is a mistake in modifying the database data code ~ What should I do?

Source: Internet
Author: User
Let's see if there is a mistake in modifying the database data code ~!!!! & Lt ;? Phpincludeinclude. php; $ sid]; $ recname $ _ POST [Recname1];? $ Description $ _ POST [Description1]; $ requirements $ _ POST [Requirements1 helps you check whether there is a mistake in modifying the database data code ~!!!!
Include 'include. php ';
$ Id = $ _ POST ['Sid '];
$ Recname = $ _ POST ['recname1'];?
$ Description = $ _ POST ['scription1'];
$ Requirements = $ _ POST ['requirements1'];
// None of the four data has been transmitted. the current error is that the modification failed. it seems that the statement for modifying the database is incorrect, but I have checked a lot of information and still have not found the answer, hope you can help us solve this problem.

If ($ requirements = ""){
Echo "script window. open ('addment. php', 'i2 _ 2'); alert (\" enter your career requirements !!! \ "); Script";
} Else {
$ Query = "update recruitment set Recname = '$ recname' description = '$ description' requirements =' $ requirements 'Where id = '$ ID '";
Echo $ query;
$ Result = mysql_query ($ query );
If (mysql_affected_rows ()> 0 ){
Echo "script window. open ('modment. php', 'i2 _ 2'); alert (\" modified successfully !!! \ "); Script";
} Else {
Echo "script window. open ('modment. php', 'i2 _ 2'); alert (\" modification failed !!! \ "); Script";
}
}

?>

------ Solution --------------------
$ Query = "update recruitment set Recname = '$ recname', description =' $ description', requirements = '$ requirements 'Where id =' $ ID '";
------ Solution --------------------
$ Query = "update recruitment set Recname = '$ recname', description =' $ description', requirements = '$ requirements 'Where id =' $ ID '";
Fields are separated by commas.
------ Solution --------------------
$ Result = mysql_query ($ query) or die (mysql_error ());
Report error
------ Solution --------------------
Output your SQL statement to phpmyadmin for execution to see if it is normal
------ Solution --------------------
1. separate fields with commas (,). This is a rule and cannot be negotiated.
2. confirm that the special characters in the input data have been escaped.
------ Solution --------------------
Fields are separated by commas. Never used.
$ Query = "update recruitment set Recname = '{$ recname}', description = '{$ description }', requirements = '{$ requirements}' where id = '{$ id }'";
You execute the SQL statement in the database to see if an error is returned.

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.