Friday, 30 August 2013

MySQL Syntax error? Strange error

MySQL Syntax error? Strange error

I need some help finding an error in my code. I'm trying to create a
database with Xammp. It's giving me this error:
You have an error in you SQL syntax; check the manual that corresponds to
you MySQL server version for the right syntax to use near ",'787') at line
1 (787 is what I entered in the ResearchCost section)
Here is my code:
<?php/*mysql_connect(servername,username,password); */
mysql_connect("localhost","root","admin") or die(mysql_error());
mysql_select_db("EndlessSpace") or die(mysql_error()); $NodeName =
$_POST["ResearchCost"]; $Quadrant = $_POST["BestPrerequisiteNode"];
$ResearchOpts = $_POST["BestRace"]; $Effects = $_POST["NodeName"];
$Influence = $_POST["ResearchOpts"]; $query=mysql_query("INSERT INTO
Requirements
(ResearchCost,BestPreRequisiteNode,BestRace,NodeName,ResearchOpts) VALUES
('$ResearchCost','$BestPrerequisiteNode','$BestRace',
'$NodeName','$ResearchOpts')") or die(mysql_error()); ?>

No comments:

Post a Comment