mysqli cannot update data
rapture
rapture 2020-02-07 15:04:07
0
5
1388

$sql="UPDATE 'student' SET 'course'='javascript','grade'=88,'WHERE 'id'=3"; prompt after running; connection successful, update failed. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''student' SET 'name'='Xiaoming', 'course'='javascript','grade'=88, 'create_tim' at line 1

rapture
rapture

reply all(4)
rapture

Ok, thank you

小梨

If you make a typo, the corresponding SQL will be prompted.

小梨

I don't understand what you are typing. You can modify it yourself in the web database online management, and then you will be prompted with the sql statement you believe.

Peter-Zhu

Field and table names should use backticks instead of single quotes...the backticks are under the ESC key

  • reply $sql="UPDATE `student`, SET `course`=`javascript`,`grade`=88,WHERE `id`=3"; I changed it to the backtick under the ESC button, but there is still an error Error message: Update failed. You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'SET `course`=`javascript`,`grade`=88,WHERE `id `=3' at line 1
    rapture author 2020-02-10 14:37:03
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template