0

I have a problem in deleting data I wrote a function in model to delete data and it works but when foreign key constraint occur it show this error:

enter image description here

and I want to handle this error in the code and when this error occurs I want to show an error message: You can't delete this data.

Rk dev tech
  • 190
  • 1
  • 14
  • delete the foreign key record and remove the master record – Abdulla Nilam Oct 16 '17 at 16:58
  • 1
    Please include the error in your question instead of referring with a link – Ibo Oct 16 '17 at 17:01
  • 1
    Possible duplicate of [Cannot delete or update a parent row: a foreign key constraint fails](https://stackoverflow.com/questions/1905470/cannot-delete-or-update-a-parent-row-a-foreign-key-constraint-fails) – Vickel Oct 16 '17 at 17:30
  • Please do not link to your code. –  Oct 16 '17 at 19:46

0 Answers0