please help (what's wrong?)

Reply

Join Date: Nov 2007
Posts: 227
Reputation: k2k is an unknown quantity at this point 
Solved Threads: 0
k2k k2k is offline Offline
Posting Whiz in Training

please help (what's wrong?)

 
0
  #1
Oct 10th, 2008
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.

  1.  
  2. CREATE TABLE customer(
  3. cid INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,
  4. fn VARCHAR(10),
  5. LN VARCHAR(10),
  6. phone VARCHAR(15));
  7.  
  8. CREATE TABLE address(
  9. street VARCHAR(40) PRIMARY KEY NOT NULL,
  10. city VARCHAR(10),
  11. cid INTEGER NOT NULL,
  12. FOREIGN KEY(cid) REFERENCES customer(cid));
  13.  
  14.  
  15. CREATE TABLE ORDER(
  16. oid INTEGER PRIMARY KEY NOT NULL AUTO_INCREMENT,
  17. o_price DOUBLE(5,2),
  18. o_date VARCHAR(10),
  19. o_time VARCHAR(10),
  20. cid INTEGER NOT NULL,
  21. FOREIGN KEY(cid) REFERENCES customer(cid));
Reply With Quote Quick reply to this message  
Join Date: Sep 2008
Posts: 1
Reputation: BargainPredator is an unknown quantity at this point 
Solved Threads: 0
BargainPredator BargainPredator is offline Offline
Newbie Poster

Re: please help (what's wrong?)

 
0
  #2
Oct 10th, 2008
Change the name of the table 'Order'. It is a reserved word
Reply With Quote Quick reply to this message  
Join Date: Dec 2007
Posts: 190
Reputation: mwasif is an unknown quantity at this point 
Solved Threads: 25
mwasif mwasif is offline Offline
Junior Poster

Re: please help (what's wrong?)

 
0
  #3
Oct 14th, 2008
Or use backticks (`) around table name.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the MySQL Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC