Deleting row from JOINed tables
Deleting row from JOINed tables
menashe
Posts: 198Questions: 44Answers: 2
in DataTables 2
Looking way back (to 2016), someone asked how to delete a row that has a value that is still a foreign key in another table.
Your response:
1. Use ON DELETE CASCADE so the child row will be deleted
2. Use a server-side event handler to delete the child row.
3. Use postSubmit to detect the error message returned from the server and modify it to be something more using friendly.1. *
I understand how to use #2 to submit a SQL command to delete the row in the "foreign" table first (you also suggested preRemove
), but how would I do #1? Where would I incorporate the ON DELETE CASCADE?
This question has an accepted answers - jump to answer
Answers
See this tutorial to see how to use
ON DELETE CASCADE
.Kevin
Thank you!