Jump to content

Recommended Posts

Here is my code

include ('DB_config.php');
$table = 'order';
$ip = $REMOTE_ADDR;  
$query = mysql_query("INSERT INTO $table (`id` , `date`, `ip`, `f_name`, `l_name`, `email`, `phone`, `address`, `address2`, `city`, `state`, `zip`, `hear`, `objectives`, `preferred`, `f_name2`, `l_name2`, `email2`, `phone2`,`address22`, `address222`, `city2`, `state2`, `zip2`, `quantity`, `card_type`, `ccn`, `exp`, `cw`, `processed`) VALUES ('NULL','NOW()','$ip','".$_POST['f_name']."','".$_POST['l_name']."','".$_POST['email']."','".$_POST['phone']."','".$_POST['address']."','".$_POST['address2']."','".$_POST['city']."','".$_POST['state']."','".$_POST['zip']."','".$_POST['hear']."','".$_POST['objectives']."','".$_POST['preferred']."','".$_POST['f_name2']."','".$_POST['l_name2']."','".$_POST['email2']."','".$_POST['phone2']."','".$_POST['address22']."','".$_POST['address222']."','".$_POST['city2']."','".$_POST['state2']."','".$_POST['zip2']."','".$_POST['quantity']."','".$_POST['card_type']."','".$_POST['ccn']."','".$_POST['exp']."','".$_POST['cw']."','n')") 
or die("Sorry, there was a problem with your order ".mysql_error());

 

I keep getting this error

Sorry, there was a problem with your order 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 'order (`id` , `date`, `ip`, `f_name`, `l_name`, `email`, `phone`, `address`, `ad' at line 1

 

Can you please advise as to why??

 

I have used this code numerous times, different values, but the same code regardless and have never gotten this error.

 

Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/90305-error-when-inserting/
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.