Jump to content

Twill1989

Members
  • Posts

    3
  • Joined

  • Last visited

Posts posted by Twill1989

  1. I tried, another error:

    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 'Number, Email Address, Shirt Size, Grade, HonorsAP, GPA, Transpo
    Here is what the new insert file looks like:
    <?php$con = mysql_connect("...","...","...");if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("...", $con);$sql="INSERT INTO person (Name, Phone Number, Email Address, Shirt Size, Grade, HonorsAP, GPA, Transportation, Why)VALUES('{$_POST['Name']}','{$_POST['Phone Number']}','{$_POST['Email Address']}','{$_POST['Shirt Size']}','{$_POST['Grade']}','{$_POST['HonorsAP']}','{$_POST['GPA']}','{$_POST['Transportation']}','{$_POST['Why']}')";if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); }echo "1 record added";mysql_close($con)?>
  2. Hi,I'm the webmaster for a organization at my school. I've been working on developing a online enlistment form for our organization, but I can't seem to get the coding correct. I worked on it for months and I have had no progress at all. This is the error I'm constantly getting:

    Parse error: parse error, expecting `']'' in ... on line 12
    Here is the insert file:
    <?php$con = mysql_connect("...","...","...");if (!$con) { die('Could not connect: ' . mysql_error()); }mysql_select_db("...", $con);$sql="INSERT INTO person (Name, Phone Number, Email Address, Shirt Size, Grade, HonorsAP, GPA, Transportation, Why)VALUES('$_POST[Name]','$_POST[Phone Number]','$_POST','$_POST[shirt Size]','$_POST[Grade]','$_POST[HonorsAP]','$_POST[GPA]','$_POST[Transportation]','$_POST[Why]')";if (!mysql_query($sql,$con)) { die('Error: ' . mysql_error()); }echo "1 record added";mysql_close($con)?>
    Can anyone tell me what I'm doing wrong? I can get the code to work if I use a smaller number of text fields. For example, if I have only four or five things to fill in, everything works fine. But with the nine I have, I always get the above error. Thanks
×
×
  • Create New...