I am working on a site to make DnD character sheets for my friends and I. The first part is done and data is POST-ing correctly but will not upload to server. I have worked on this problem for along time and still cannot figure it out. All of the stuff is spelled the same as server and the server is connected. The error I get with mysqli_error() is:
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server for the right syntax to use near'character(id, username, characterName, class, level, race, alignment, deity, si' at line 1
I put echo before the problem to make sure everything is working before uploaded and everything is working fine but will not upload. The $bd is connection and is working because i use it with other pages.
This is my code:
echo ($id . "<br />");
echo ($username . "<br />");
echo ($characterName . "<br />");
echo ($class . "<br />");
echo ($level . "<br />");
echo ($race . "<br />");
echo ($alignment . "<br />");
echo ($deity . "<br />");
echo ($size . "<br />");
echo ($age . "<br />");
echo ($gender . "<br />");
echo ($height . "<br />");
echo ($weight . "<br />");
echo ($eyes . "<br />");
echo ($hair . "<br />");
echo ($skin . "<br />");
echo ($mysql_hostname . "<br />");
echo ($mysql_user . "<br />");
echo ($mysql_password . "<br />");
echo ($mysql_database . "<br />");
if(isset($_POST['nc1']))
{
$query = "INSERT INTO characters (id, username, characterName, class, level, race, alignment, deity, size, age, gender, height, weight, eyes, hair, skin) VALUES ('$id', '$username', '$characterName', '$class', '$level', '$race', '$alignment', '$deity', '$size', '$age', '$gender', '$height', '$weight', '$eyes', '$hair', '$skin')";
mysqli_query($bd,$query) or die('Error: ' . mysqli_error($bd));
//header('location:success.php');//Redirect To Success Page
echo ("success");
}