How to delete foreign key
How to delete foreign key

Help me, thanks ( English so bad)
table department (ID_dep , Name)
table lecturer(ID , Name, ID_dep)
delete ID_dep , error "SQLSTATE[23000]: Integrity constraint violation: 1451 Cannot delete or update a parent row: a foreign key constraint fails".
How do I delete a foreign key?
This discussion has been closed.
Answers
Hi,
What software you are using to do the delete? Is it Editor's PHP or .NET libraries? If so, what you'll need to do is either disallow deleting of rows which rows in other tables are dependent upon, or use
ON DELETE CASCADE
in your database so the child row is also deleted.Regards,
Allan