How does php modify the field content in the table: the content in this field, but cannot be written. & lt ;? Php & nbsp; $ query & nbsp; mysql_query (SELECT & nbsp; * & nbsp; FROM & nbsp; wdksm & nbsp;); how does whil php modify the field content in the table?
For Cainiao, how does one modify the content of a field without changing other fields? now I want to modify the content in the 'Department owner review: 'field, but it cannot be written.
While ($ row = mysql_fetch_assoc ($ query ))
{
Echo 'date: '. $ row [time]. '';
Echo 'Department: '. $ row [bumen]. '';
Echo 'name: '. $ row [name]. '';
Echo 'Title: '. $ row [zhiwu].'
';
Echo 'time not punched in: '. $ row [wdktime].'
';
Echo 'reason for not logging in: '. $ row [wdkyy].'
';
Echo 'Department owner review: '. $ row [bmshtime]. '';
Echo 'approval from the personnel administration department/General Manager: '. $ row [rsshtime].'
';
Echo' ';
Echo'
';
}
Echo '';
Mysql_query ('update wdksm SET
Bmshtime = \ ''. $ _ POST ['test']. '\'
WHERE time = \ ''. $ row [id]. '\'
');
?>
------ Solution ----------------------
If you want to connect to mysql, you can use the following code to analyze your source code:
$ Query = mysql_query ('select * FROM wdksm ');
While ($ row = mysql_fetch_assoc ($ query ))
{
$ Id = $ row ['id']; // The id number to be modified is not obtained. it should be obtained here.
Echo 'date: '. $ row ["time"]. '';
Echo 'Department: '. $ row ["bumen"]. '';
Echo 'name: '. $ row ["name"]. '';
Echo 'Title: '. $ row ["zhiwu"].'
';
Echo 'time not punched in: '. $ row ["wdktime"].'
';
Echo 'The reason for not logging in: '. $ row ["wdkyy"].'
';
Echo 'Department owner review: '. $ row ["bmshtime"]. '';
Echo 'approval from the personnel administration department/General Manager: '. $ row ["rsshtime"].'
';
// Echo''; // The submit button is placed outside the form, causing the form to fail to be submitted
Echo'
';
}
Echo '';
/* Mysql_query ('update wdksm SET
Bmshtime = \ ''. $ _ POST ['test']. '\'
WHERE time = \ ''. $ row [id]. '\' // SQL statement with severe errors
');*/
// Correct SQL statement
$ SQL = 'update wdksm SET
Bmshtime = \ ''. $ _ POST ['test']. '\'
WHERE id = \ ''. $ id .'\'
';
Mysql_query ($ SQL );
The execution result is successfully modified 'Department owner Review '.