How to modify the contents of a table field in PHP
Rookie help How to change the contents of a field without changing the other fields, I would like to modify the ' Department Responsible person Audit: ' The contents of this field, but have not been written in
while ($row = Mysql_fetch_assoc ($query))
{
Echo ' Date: '. $row [time]. ' ';
Echo ' department: '. $row [bumen]. ' ';
Echo ' name: '. $row [name]. ' ';
Echo ' duties: '. $row [Zhiwu]. '
';
Echo ' No Clock out time: '. $row [wdktime]. '
';
Echo ' not clocked out reason: '. $row [Wdkyy]. '
';
Echo ' Department Responsible person audits: '. $row [bmshtime]. ' ';
Echo ' Personnel Administration department/General manager approves: '. $row [rsshtime]. '
';
Echo ' ';
Echo '
';
}
Echo ';
mysql_query (' UPDATE wdksm SET
Bmshtime = \ '. $_post[' Test ']. '\'
WHERE time = \ '. $row [id]. '\'
');
?>
------to solve the idea----------------------
If you want a MySQL connection, you can use the following code to analyze your source codes:
$query = mysql_query (' SELECT * from Wdksm ');
while ($row = Mysql_fetch_assoc ($query))
{
$id = $row [' id ']; The ID number to be modified is not taken and should be obtained here
Echo ' Date: '. $row ["Time"]. " ;
Echo ' department: '. $row ["Bumen"]. " ;
Echo ' name: '. $row ["name"]. " ;
Echo ' duties: '. $row ["Zhiwu"]. '
';
Echo ' No Clock out time: '. $row ["Wdktime"]. '
';
Echo ' not clocked out reason: '. $row ["Wdkyy"]. '
';
Echo ' Department Responsible person audits: '. $row ["Bmshtime"]. " ;
Echo ' Personnel Administration department/General manager approves: '. $row ["Rsshtime"]. '
';
Echo ''; The Submit button is placed outside the form, causing the form to fail to submit
Echo '
}
Echo ';
Bmshtime = \ '. $_post[' Test '] . '\'
WHERE time = \ '. $row [id]. ' \ ' //Critical Error SQL statement
');*/
The correct SQL statement
Bmshtime = \ '. $_post[' Test '] . '\'
';
mysql_query ($sql);
The result of the implementation is the successful revision of the ' Department responsible person audit '.