Hi guys,
I'm getting this error when trying to insert data from a form into a database. I know what it means, I just can't figure out why I'm getting it. Perhaps I've been starting at it for too long and have missed something?
Here is my code:
<?php
$q1 = mysql_escape_string($_POST['q1']);
$q2 = mysql_escape_string($_POST['q2']);
$q3 = mysql_escape_string($_POST['q3']);
$q4 = mysql_escape_string($_POST['q4']);
$q5 = mysql_escape_string($_POST['q5']);
$q6 = mysql_escape_string($_POST['q6']);
$q7 = mysql_escape_string($_POST['q7']);
$q8 = mysql_escape_string($_POST['q8']);
$q9 = mysql_escape_string($_POST['q9']);
$q10 = mysql_escape_string($_POST['q10']);
$q11a = mysql_escape_string($_POST['q11a']);
$q11b = mysql_escape_string($_POST['q11b']);
$q11c = mysql_escape_string($_POST['q11c']);
$q11d = mysql_escape_string($_POST['q11d']);
$q11e = mysql_escape_string($_POST['q11e']);
$q11f = mysql_escape_string($_POST['q11f']);
$q11g = mysql_escape_string($_POST['q11g']);
$q11h = mysql_escape_string($_POST['q11h']);
$q12 = mysql_escape_string($_POST['q12']);
$q13 = mysql_escape_string($_POST['q13']);
$q14a = mysql_escape_string($_POST['q14a']);
$q14b = mysql_escape_string($_POST['q14b']);
$name = mysql_escape_string($_POST['name']);
$email = mysql_escape_string($_POST['email']);
require_once('connection.php');
$sql="INSERT INTO survey (Question1, Question2, Question3, Question4, Question5, Question6, Question7, Question8, Question9, Question10, Question11A, Question11B, Question11C, Question11D, Question11E, Question11F, Question11G, Question11H, Question12, Question13, Question14A, Question14B, name, email) VALUES ('$q1', '$q2', '$q3', '$q4', '$q5', '$q6', '$q7', '$q8', '$q9', '$q10', '$q11a','$q11b', '$q11c','$q11d', '$q11e', '$q11f','$q11g','$q11h','$q12', '$q13', '$q14a', '$q14b' '$name', '$email')";
if (!mysql_query($sql,$conn))
{
die('Error: ' . mysql_error());
}
mysql_close($conn);
?>