私は一種のブログをいじっています。エラーが発生し、次のように言うと:
私のPHPは次のとおりです。
$query = "INSERT INTO articles (articleTitle, articleType, articleText, userID)
VALUES('$articleTitle', '$articleType', '$articleText', '$userID')";
$result = mysql_query($query);
var_dump($articleTitle);
var_dump($articleType);
var_dump($articleText);
var_dump($userID);
var_dump($result);
echo mysql_error();
私の結果はこれです:
string 'New News! (Sounds like noo noo's)' (length=33)
string 'News' (length=4)
string 'NEWS is here! This is Michael Bender reporting on the new news that we now have news! Isn't that exciting news?' (length=111)
string '1' (length=1)
boolean false
SQL 構文にエラーがあります。's)'、'News'、'NEWS is here! の近くで使用する正しい構文については、MySQL サーバーのバージョンに対応するマニュアルを確認してください。これは、2行目の新しいニュースについて報告しているMichael Benderです
では、なぜ mysql は私のクエリを受け入れないのでしょうか? ありがとう!