php – 您的SQL语法有错误;查看与MariaDB服务器版本对应的手册,以获取正确的语法

我一直收到错误: –

“You have an error in your SQL syntax; check the manual that
corresponds to your MariaDB server version for the right syntax to use
near ‘Password=’evertonblues’ Forename=’Josh’ Surname=’Edmondson’
Date of Birth=’199′ at line 1″

运行更新查询时出错.

$result = mysqli_query($con, "UPDATE Users SET Username='".$newUsername."' Password='".$newPassword."' Forename='".$newForename."' Surname='".$newSurname."' `Date of Birth`='".$newDateofBirth."'     Address='".$newAddress."' `Post Code`='".$newPostcode."' Email='".$newEmail."' `Phone Number`='".$newPhonenumber."' WHERE `User ID`='".$newUserid."';");

解决方法:

你忘记了一堆逗号:

..snip... SET Username='".$newUsername."' Password='".$newPassw
                                         ^-- and many others
上一篇:自PHP 7起,不支持使用弃用的PHP4样式类构造函数


下一篇:导入警告:不使用wxPython导入目录问题,不知道如何修复