5

誰かが間違いを見つけることができますか:

mysqli_query($connection, "INSERT INTO comments (event_id, fulltext, date_posted) VALUES (5, 'Hallo', 430234)");

接続は確立されますが、新しい行は挿入されません。

include("../../connect.php");

$event_id = intval($_GET["event_id"]);
$fulltext = $_GET["fulltext"];
$date = intval($_GET["date"]);

mysqli_query($connection, "INSERT INTO comments ('event_id', 'fulltext', 'date_posted') VALUES (5, 'Hallo', 430234)");

echo "INSERT INTO comments (event_id, fulltext, date_posted) VALUES (5, 'Hallo', 430234)";

mysqli_close($connection);
4

1 に答える 1

6

FULLTEXTmysqlの予約語です。列名として使用することはできません。`列名の周りのクエリの下で使用します。

mysqli_query($connection, "INSERT INTO comments 
(`event_id`, `fulltext`, `date_posted`) VALUES (5, 'Hallo', 430234)");
于 2013-04-04T06:21:58.380 に答える