mysql - Getting error 1064 while running query for table creation? -


i have created customers , products table.i getting error while running following command in phpmyadmin.
create table orders ( id int not null auto_increment, ordernumber int, productid int, customerid int, orderdate datetime default current_timestamp, primary key(id), primary key (customerid) references customers(id) , foreign key (productid) references products(id) );

1064 error

can not create more 1 primary keys.

try code.

create table orders ( id int not null auto_increment, ordernumber int, productid int, customerid int, orderdate datetime default current_timestamp, primary key(id), foreign  key (customerid) references customers(id) , foreign key (productid) references products(id)); 

Comments

Popular posts from this blog

node.js - Node js - Trying to send POST request, but it is not loading javascript content -

javascript - Replicate keyboard event with html button -

javascript - Web audio api 5.1 surround example not working in firefox -