DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   MySQL (http://www.daniweb.com/forums/forum126.html)
-   -   please help (what's wrong?) (http://www.daniweb.com/forums/thread150426.html)

k2k Oct 10th, 2008 4:20 pm
please help (what's wrong?)
 
would anybody please point out what is wrong with the "order table" .. i spent hours and can't figure it out why this simple table won't work. i appreciate it.


CREATE TABLE customer(
cid INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,
fn VARCHAR(10),
ln VARCHAR(10),
phone VARCHAR(15));

CREATE TABLE address(
street VARCHAR(40) PRIMARY KEY NOT NULL,
city VARCHAR(10),
cid INTEGER NOT NULL,
FOREIGN KEY(cid) REFERENCES customer(cid));


CREATE TABLE order(
oid INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,
o_price DOUBLE(5,2),
o_date VARCHAR(10),
o_time VARCHAR(10),
cid INTEGER NOT NULL,
FOREIGN KEY(cid) REFERENCES customer(cid));

BargainPredator Oct 10th, 2008 8:04 pm
Re: please help (what's wrong?)
 
Change the name of the table 'Order'. It is a reserved word

mwasif Oct 14th, 2008 4:11 pm
Re: please help (what's wrong?)
 
Or use backticks (`) around table name.


All times are GMT -4. The time now is 11:59 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC