此查询有什么问题?语法错误


What's wrong with this query? Syntax error

这有什么问题?它返回"您的语法有误...检查您是否有正确的MySQL版本在"到,内容,链接)值..."

$notito = $idoftheguy;
$contentofnoti = $username." just posted a comment on your update.";
$linkofnoti = "http://mywebsite.net/post.php?id=".$thepostid;
/* Now let's insert this */
$insertnoti = mysql_query("INSERT INTO newnotifications (to, content, link) VALUES ('$notito', '$contentofnoti', '$linkofnoti')");

查询中的所有上述内容都存在于数据库中。以下是给出错误的确切输入(没有尝试任何其他输入):

$notito = 1;
$contentofnoti ="Schart 刚刚对您的更新发表了评论。
$linkofnoti = "http://mywebsite.net/post.php?id=22";

如前所述。 to是一个保留的词。试试这个代码:

$insertnoti = mysql_query("INSERT INTO newnotifications (`to`, `content`, `link`) VALUES ('$notito', '$contentofnoti', '$linkofnoti')");