Reputation: 943
I cannot see to find the problem in this php code:
if ($stmt = $mysqli->prepare("INSERT INTO Champions(Spell 1) VALUES(?)")) {
$stmt->bind_param('s', $SP1);
$stmt->execute();
$stmt->close();
}
else {
printf("Errormessage: %s\n", $mysqli->error);
}
}
Just throws the error: 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 '1) VALUES (?)' at line 1
Upvotes: 0
Views: 26
Reputation: 13738
CAUSE YOU HAVE SPACE IN FIELD NAME
Spell 1
try with proper fieldname
INSERT INTO Champions(Spell 1) VALUES(?)
^
or use quoting(not tried)
INSERT INTO Champions(`Spell 1`) VALUES(?)
Upvotes: 1