Php MySql查询-语法错误
下面的代码是我在PHP中使用的SQL查询Php MySql查询-语法错误,php,mysql,Php,Mysql,下面的代码是我在PHP中使用的SQL查询 $sql = "INSERT INTO updates (update,user_id_fk) VALUES ('$post_update','$username')"; 它不工作-当它运行时,我收到以下错误消息 Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the righ
$sql = "INSERT INTO updates (update,user_id_fk)
VALUES ('$post_update','$username')";
它不工作-当它运行时,我收到以下错误消息
Error: 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 'update,user_id_fk)
这种语法对我来说很好——它与我在W3S上发现的语法相同
我使用的mysql版本是5.5.24,更新是一个保留关键字,请勾选它
INSERT INTO updates (`update`,user_id_fk)
检查下面的列表,以后不要在表名或列名中使用这些词
更新是一个保留关键字,请勾选它
INSERT INTO updates (`update`,user_id_fk)
检查下面的列表,以后不要在表名或列名中使用这些词
使用库来帮助您编写查询。使用库来帮助您编写查询。这不是单引号倒勾``您的语法还可以,但您需要对保留关键字使用倒勾,只需复制我的答案并将其粘贴到您的代码中,backtick不是单引号。那不是单引号那是backtick``你的语法还可以,但你需要对保留关键字使用backtick,只要复制我的答案并粘贴到你的代码中,backtick不是单引号。