Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: create join table problem
06-04-2011, 01:43 AM #1
- Join Date
- Sep 2010
- The Twilight Zone
- Thanked 2 Times in 2 Posts
create join table problem
I have 3 tables
customer, menu, and order. The order table is suppose to join the customer and menu tables, and contains the primary keys of both. Here's how I tried to create the order table on phpmyadmin.
create table order(
customerID int not null,
itemID int not null,
primary key (customerID, itemID),
foreign key(customerID) reference customer(ID),
foreign key(itemID) reference menu(itemID)
06-04-2011, 02:31 AM #2
Well, for one thing, the keyword is references with an "s" on the end.
Other than that, it looks okay. What message do you get?
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.