0

これの何が問題なのですか?「構文にエラーがあります... ...「to、content、link) VALUES の近くで使用する適切な 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 ";

4

1 に答える 1

1

すでに述べたように。toは予約語です。このコードを試してください:

$insertnoti = mysql_query("INSERT INTO newnotifications (`to`, `content`, `link`) VALUES ('$notito', '$contentofnoti', '$linkofnoti')");
于 2013-10-18T23:59:54.343 に答える