View Full Version : create join table problem

06-04-2011, 02:43 AM
Hey guys,

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)

This doesn't work. What am I doing wrong?!!

Old Pedant
06-04-2011, 03:31 AM
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?