What I want to do is put a Foreign Key from users_table
column id
into users_order
table in the column user_id
but when I try to do it says this. what did I do wrong or is there any other way to add foreign key to table in PhpMyAdmin ?
#1452 - Cannot add or update a child row: a foreign key constraint fails (`users`.`#sql-4830_792`, CONSTRAINT `#sql-4830_792_ibfk_1` FOREIGN KEY (`id`) REFERENCES `user_order` (`user_id`))
index
on 'user_id' column of 'user_order' table? – Himanshu Upadhyay