Quantcast
Channel: MySQL Forums - InnoDB
Viewing all articles
Browse latest Browse all 1957

Cannot add or update a child row: a foreign key constraint fails (2 replies)

$
0
0
Hi everyone ,

I have two tables namely users & roles.

users include users_id(primary key),users_name,users_email,roles_id(foreign key)
roles include roles_id(primary key),roles_name.

Both tables are innodb. I am trying to insert/update data in 'users' table but i am unable to insert/update.

it display follwing error
Cannot add or update a child row: a foreign key constraint fails.

Regards,
Anas Anjaria

Viewing all articles
Browse latest Browse all 1957

Trending Articles