dongxun1142 2014-03-28 13:36
浏览 21
已采纳

Mysqli错误,出了什么问题?

$con=mysqli_connect(....stuff.....);

Here is the main part:

$sql2="INSERT INTO keys
(id,forgotkey)
 VALUES 
 ( '1' , '3453' ) ";

if(!$result2=mysqli_query($con,$sql2)){
    echo mysqli_error($con);
}

I get this 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 'keys(id,forgotkey) VALUES ( '1' , '3453' )' at line 1

  • 写回答

3条回答 默认 最新

  • douqiao5440 2014-03-28 13:43
    关注

    keys is a mysql reserved keyword so it intreprets it as command not as a table name.

    Change your table's name or use `keys` <= this is not a quotation mark.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?