Can anyone tell me whats wrong with this code? The mysql error I get is generic and says
"Could not enter data: 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 'Tickets (Name,Tech,Node,Address,Tap,Ped,Lash,Hardline,Other,Comments) VALUES ('C' at line 1"
<?php
$name=$_POST['name'];
$id=$_POST['id'];
$node=$_POST['node'];
$ped=$_POST['ped'];
$tap=$_POST['tap'];
$lash=$_POST['lash'];
$hardline=$_POST['hardline'];
$other=$_POST['other'];
$address=$_POST['address'];
$city=$_POST['city'];
$comments=$_POST['comments'];
$dbhost = 'xxxx';
$dbuser = 'xxxx';
$dbpass = 'xxxx';
$conn = mysql_connect($dbhost, $dbuser, $dbpass);
if(! $conn )
{
die('Could not connect: ' . mysql_error());
}
$sql = "INSERT INTO Damage Tickets (Name,Tech,Node,Address,Tap,Ped,Lash,Hardline,Other,Comments) VALUES ('$name','$id','$node','$address','$city','$tap','$ped','$lash','$hardline','$other','$comments')";
mysql_select_db('xxxxx');
$retval = mysql_query( $sql, $conn );
if(! $retval )
{
die('Could not enter data: ' . mysql_error());
}
echo "Your Damage has been Submitted! <a href=\"damage.php\">Go Back</a>";
mysql_close($conn);
?>
No idea whats wrong with it? Thanks for any help