title: Query Failed!You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version
body: <p>I am trying to put this into the database. And I am getting an unexpected error, however, saying:</p>
  
  <blockquote>
    <p>Query Failed! 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(Order_Date,Order_Time,Delivery_Charge,Delivery_Fname,Delivery_Lname,Delive' at line 1.</p>
  </blockquote>
  
  <p>Here's my PHP:</p>
  
  <pre><code>&lt;?php
  //error_reporting(E_ERROR | E_PARSE);  
  include("includes/db.php");
  include("includes/functions.php");
  
  if($_REQUEST['command']=='update')
  {
  $date     = date('Y-m-d');
  $time     = time('H:i:s');
  $charge   = $_REQUEST['ocharge'];
  $fname    = $_REQUEST['ofname'];
  $lname    = $_REQUEST['olname'];
  $mobile   = $_REQUEST['omobile'];
  $add1     = $_REQUEST['oadd1'];
  $add2     = $_REQUEST['oadd2'];
  $postcode = $_REQUEST['opostcode'];
  $state    = $_REQUEST['ostate'];
  $country  = $_REQUEST['ocountry'];
  $weight   = $_REQUEST['oweight'];
  $credit   = $_REQUEST['ocredit'];
  $pin      = $_REQUEST['opin'];
  $city     = $_REQUEST['ocity'];
  
  
  
      $result=mysql_query("insert into order(Order_Date,Order_Time,Delivery_Charge,Delivery_Fname,Delivery_Lname,Delivery_HP,Delivery_Street1,Delivery_Street2,Delivery_Postcode,Delivery_State,Delivery_Country,Total_Weight,Credit_No,Pin_No,Delivery_City) values ('$date',$time,$charge,'$fname','$lname',$mobile,'$add1','$add2',$postcode,'$state','$country',$weight,$credit,$pin,'$city')");
  
      if($result === FALSE)
      {
              die("Query Failed!".mysql_error().$result);
      }
  
      $orderid=mysql_insert_id();   
  
  
      $max=count($_SESSION['cart']);
      for($i=0;$i&lt;$max;$i++)
      {
          $pid=$_SESSION['cart'][$i]['productid'];
          $q=$_SESSION['cart'][$i]['qty'];
          $price=get_price($pid);
  
          mysql_query("insert into order_detail (Order_ID,Product_ID,Order_Quantity,Sub_Total) values ('$orderid','$pid','$q','$price')");    
      }
  
      die('Thank You! your order has been placed!');
  
    }
    ?&gt;
  </code></pre>
  
  <p>What is wrong with the query?</p>