Database Foreign key Problem - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Database Foreign key Problem (/showthread.php?tid=61034) |
Database Foreign key Problem - El Forum - 09-02-2014 [eluser]rainfall[/eluser] This problem occurred when i trying to insert data in tbl_add_designation table Code: Error Number: 1452 detp_id is the foreign key for department table . How to solve it ?? Database Foreign key Problem - El Forum - 09-02-2014 [eluser]CroNiX[/eluser] You'd be better off googling that standard mysql error and learn about it. Hard to answer exactly why it happens for you without knowing your db schema. But if I had to guess the dept_id does not exist in your department table, so you can't use it in another table that has the fk constraint. |