mysql creating table foreign key -


i've created table :

create table users ( id int(6) unsigned auto_increment primary key ,uname varchar(50) ,usecondname varchar(50) ,email varchar(50) 

)

after insert data without problems. when i've tried create new table foreign key referenced users.id i've got error:

create table posts( id int(6) auto_increment not null ,ptitle varchar(155) not null default 'not_set' ,ptext text ,pauthor int(6)  ,primary key(id) ,constraint fk_perauthor foreign key (pauthor) references users(id) on delete cascade on update cascade ); 

did miss something?


Comments

Popular posts from this blog

searchKeyword not working in AngularJS filter -

sequelize.js - Sequelize: sort by enum cases -

user interface - how to replace an ongoing process of image capture from another process call over the same ImageLabel in python's GUI TKinter -