我目前正在关注 PHP 教程,并且我有以下代码::
$sql = "insert into practice (title, synopsis, genre, release, score, poster)
values('{$title}','{$synopsis}','{$genre}','{$release}','{$score}','{$poster}')";
if ($result = $mysqli->query($sql)) {
// movie successfully added
// redirect to index.php
header("Location: index.html");
exit;
}
elseif ($mysqli->connect_errno) {
// there was a database error when inserting
printf("Insert failed: %s\n", $mysqli->error);
}
else {
printf("Sorry this isn't working! Insert failed: %s\n", $mysqli->error);
}
我目前收到的错误是“对不起,这不起作用......” mysqli 错误只是说明:
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 'release, score, poster) values ('fa','f','ff','ff','ff','ff')' at line 1.
我是一个完全的新手,所以我对语法错误实际上可能是什么感到有点迷茫。感谢您提前提供任何帮助