Jump to content

[SOLVED] Insert syntax error


jim.davidson

Recommended Posts

I’m running PHP 5.0 MySQL 4.1.21 dreamweaver 8

 

I get the following insert syntax error, any idea what’s wrong?

 

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 'main st,apt2,aliquippa,PA,15001,jim davidson,123-456-7890,[email protected],test)' at line 2

 

// place insert customer info here

    $insertSQL="INSERT INTO customers (first_name, last_name, address_1, address_2, city, state, zip, contact_name, contact_phone, contact_email, contact_comments)

VALUES (".$_SESSION['contact_first_name'].",".$_SESSION['contact_last_name'].",".$_SESSION ['contact_address1'].",".$_SESSION ['contact_address2'].",".$_SESSION ['contact_city'].",".$_SESSION ['contact_state'].",".$_SESSION ['contact_zip'].",".$_SESSION['contact_name'].",".$_SESSION['contact_phone'].",".$_SESSION['contact_email'].",".$_SESSION['contact_comments'].")";

                     

  mysql_select_db($database_imcrecycle, $imcrecycle);

  $Result1 = mysql_query($insertSQL, $imcrecycle) or die(mysql_error());

 

Link to comment
https://forums.phpfreaks.com/topic/45598-solved-insert-syntax-error/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.