Tell me more ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

1064 - 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 ( orderID VARCHAR(6) NOT NULL DEFAULT 0, orderDate DATE NOT NULL DEFAULT' at line 1

DROP DATABASE IF EXISTS tupperware;
CREATE DATABASE tupperware;
USE tupperware;

CREATE TABLE login (
user_name VARCHAR(10) NOT NULL DEFAULT '',
password VARCHAR(10) NOT NULL DEFAULT '',
email VARCHAR(30) NOT NULL DEFAULT '',
account_type VARCHAR(10) NOT NULL DEFAULT '',
ic INT(10) NOT NULL DEFAULT 0,
telephone_no INT(20) NOT NULL DEFAULT 0,
pin INT(20) NOT NULL DEFAULT 0,
gender VARCHAR(10) NOT NULL DEFAULT '',
shipping_address VARCHAR(100) NOT NULL DEFAULT '',
city VARCHAR(10)  NOT NULL DEFAULT '',
state VARCHAR(10) NOT NULL DEFAULT '', 
country VARCHAR(10) NOT NULL DEFAULT '',
zip_code INT(10) NOT NULL DEFAULT 0,
credit_type VARCHAR(10) NOT NULL DEFAULT '',
credit_number INT(20) NOT NULL DEFAULT 0,
cvv2 INT(3) NOT NULL DEFAULT 0
); 

CREATE TABLE products(
productID VARCHAR(6) NOT NULL DEFAULT 0,
productName VARCHAR(255) NOT NULL DEFAULT "",
warranty_date INT(3) NOT NULL DEFAULT 1,
productDiscount INT(3) NOT NULL DEFAULT 0,
listPrice DECIMAL(10,2) NOT NULL DEFAULT 0,
category VARCHAR(10) NOT NULL DEFAULT ""
);

CREATE TABLE order VALUES(
orderID VARCHAR(6) NOT NULL DEFAULT 0,
orderDate DATE NOT NULL DEFAULT '',
claimCondition VARCHAR(30) NOT NULL DEFAULT ''
);

CREATE TABLE feedback(
message VARCHAR(1000) NOT NULL DEFAULT '',
messageDate DATE NOT NULL DEFAULT '',
feedbackID INT(3) NOT NULL DEFAULT 0
);
share|improve this question
What's the question? – paulmorriss Jun 13 '12 at 15:29
#1064 - 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 ( orderID VARCHAR(6) NOT NULL DEFAULT 0, orderDate DATE NOT NULL DEFAULT' at line 1 – tricor Jun 13 '12 at 15:35

closed as off topic by paulmorriss, John Conde Jun 13 '12 at 15:59

Questions on Webmasters Stack Exchange are expected to relate to webmastering within the scope defined in the FAQ. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about closed questions here.

1 Answer

order is a reserved keyword in MySQL. You should either change it or use ticks (`) around it:

CREATE TABLE `order` VALUES(
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.