This is a question same as ON DELETE CASCADE not working in MySQL question where the My-ISAM engine is not doing its ON DELETE CASCADE part. But the problem is i have to use MyISAM table type itself and not InnoDB
How can i ensure that i can simulate the ON DELETE CASCADE when ever a row gets deleted in my parent table, so that its updated in many other tables it is referencing it.? Can i write some kind of trigger?
From the fine manual:
So if you need ON DELETE CASCADE behavior and MyISAM tables at the same time then you’ll have to do the CASCADE part by hand with a DELETE trigger or something similar outside the database. Adding a trigger like this should work:
That’s just off the top of my head and the table and column names are, of course, just for demonstration purposes.