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.