I'm currently following a PHP tutorial, and I've got the following code::
$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);
}
I'm currently getting the error that states "Sorry this isn't working..." the mysqli error simply states:
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.
I'm a complete newbie so I'm a bit lost in terms of what the syntax error might actually be. Thanks for any help in advance