简体   繁体   中英

How to update two fields in mysql using php via a input form

I believe I have a issue with in mysql query. Please take a look at the code and let me know if there is something wrong in this statement.

$sql = "UPDATE `Blog` SET `Employee_Name` = '$emp_name', 'Employee_Email' = '$emp_email'      WHERE `Blog`.`Id` = '$emp_id'";

Bad quoting:

$sql = "UPDATE `Blog` SET `Employee_Name` = '$emp_name', 'Employee_Email' = '$emp_email'      
                                                         ^--------------^--- 

The indicated quotes should be backticks (`), not single quotes (').

And if you had proper (or any at all) proper error handling on your query calls, you'd have been told about the syntax error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM