Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6788207
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:27:27+00:00 2026-05-26T17:27:27+00:00

I have an error message coming up with the following code I have used.

  • 0

I have an error message coming up with the following code I have used. The error message I am getting is:

 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 values (34 1,1,250,2011-11-09,jahed)' at line 1

the code i have provided with you below starts from line 1!

<?php

    session_start();
    ?>
    <?php
    if(!isset($_SESSION["username"]))
    {
        header("Location: shoppinglogin.php");
    }
    ?>

    <?
        include("includes/db.php");
        include("includes/functions.php");

        if($_REQUEST['command']=='update'){
            $name=$_REQUEST['name'];
            $email=$_REQUEST['email'];
            $address=$_REQUEST['address'];
            $phone=$_REQUEST['phone'];

            $result=mysql_query("insert into customers values('','$name','$email','$address','$phone')");


        $max=count($_SESSION['cart']);
            for($i=0;$i<$max;$i++){
                $orderid=mysql_insert_id();
                $pid=$_SESSION['cart'][$i]['productid'];
                $q=$_SESSION['cart'][$i]['qty'];
                $price=get_price($pid);
                $date=date('Y-m-d');
                $user=$_SESSION['username'];
                mysql_query("insert into order values ('$orderid','$pid','$q','$price','$date','$user')")

                    or die(mysql_error());

            }
            die('Thank You! your order has been placed!');
            session_unset(); 
        }
    ?>

Thanks for any help 🙂

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T17:27:28+00:00Added an answer on May 26, 2026 at 5:27 pm

    Order is a keyword. Use backtick character:

    insert into `order` values('$orderid','$pid','$q','$price','$date','$user')
    

    In general, it’s good not to use keywords in table/column names (like order, group, select , etc)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I keep getting the following error message ERROR 1064 (42000): You have an error
I have the following CPP code snippet and the associated error message: Code snippet
I have a table row that has the error message in it. <tr runat=server
I am getting an error message expression must have constant value when initializing an
I have been helping someone debug some code where the error message was Day
Hello I have an extended stored procedure that sends an error message. srv_sendmsg(pSrvProc, SRV_MSG_ERROR,
I have a gwt project that uses gwt-mosaic. Here is the error message I
I have the following error message: 'System.Collections.Generic.Dictionary<int,SpoofClass>' does not contain a definition for 'biff'
I have this error message: Msg 8134, Level 16, State 1, Line 1 Divide
I have one user who gets an error message when he closes his browser.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.