Reputation: 117
In my database there are 3 tables of importance: Jobs, Login and Staff. Jobs acts as a linking table, containing both the LoginID & StaffID. I have setup cascading via PHPMyAdmin, like so:
However, when I delete a row from the Jobs table, it ONLY deletes from the jobs table and not from corresponding rows from the jobs and login table. What is the reason for this? Thanks.
Upvotes: 0
Views: 896
Reputation: 31153
The cascading goes the other way. When you say in jobs table that it refers to login and staff and want to cascade deletes it means that when you delete an item in login or staff the deletion will cascade into jobs table and all rows referring to that row in login or staff will also be deleted.
So in your case jobs is the child table and login/staff are parents. You can't cascade from jobs to login and staff because that would go from child to parent.
Upvotes: 1