mysql error "cannot add foreign key constraint" -


here mysql query:

alter table wp_juices_members add constraint fk_juiceid foreign key(juice_id) references wp_juices(id) 

all tables, fields exist correct names specified in above query, , still error:

"cannot add foreign key constraint"

here desc 2 tables:

wp_juices_members:

field       type    null    key default    id          int(11) unsigned    no  pri null    auto_increment member_id   int(11) yes     null     juice_id    int(11) 

wp_juices:

field   type    null    key default    id  int(11) unsigned    no  pri null    auto_increment name    varchar(255)    no      null     

update: figured out, fields being matched have same type, , adjectives unsigned or not not null etc. help.

you might want add description of table using desc table_name update question.

the common reason number of digit in each of column want link reference different maybe int(11) unsigned , int(11) signed create big difference.


Comments

Popular posts from this blog

android - MPAndroidChart - How to add Annotations or images to the chart -

javascript - Add class to another page attribute using URL id - Jquery -

firefox - Where is 'webgl.osmesalib' parameter? -