How PHP modifies the contents of a field in a table

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