#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    2
    Rep Power
    0

    Noob: Error in create table syntax


    I am making a sql database for a side project (learn PHP/MySQL) for a web site similar to amazon.

    I have an error in this table:
    create table Order ( prod_name varchar(100) not null, prod_id mediumint not null, bill_id varbinary(80) not null, Date datetime not null, Exp_date datetime, address varchar(120) not null, city varchar(80) not null, state/province varchar(40) not null, country varchar(60) not null, area_id varchar(12) not null, order_id mediumint not null auto_increment, quantity tinyint not null, PRIMARY KEY(order_id) );

    error message:
    Code:
    ERROR 1064 (42000): 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 (
    prod_name varchar(100) not null,
    prod_id mediumint not null,
    bill_id var' at line 1
    I guess its just something I'm not seeing.
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2007
    Location
    Purley, Surrey
    Posts
    248
    Rep Power
    37
    "Order" is a reserved word. Try naming your table something different.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    2
    Rep Power
    0
    Originally Posted by TonyF123
    "Order" is a reserved word. Try naming your table something different.
    Thanks

IMN logo majestic logo threadwatch logo seochat tools logo