If you use the InnoDB engine, you can set up proper relationships. You have a Foreign key in the child tables that ties it to the Parent table. There are Constraints set to the built into the InnoDB that you set for ON DELETE and ON UPDATE, and when the Parent is deleted, there is a cascade to delete all children.
Read here: http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html On May 20, 2:48 pm, Jorge Garifuna <[email protected]> wrote: > I just deleted a post with comments and the comments related to that > post were not deleted (left as orphan records). > > Is there a way to delete related records when the master gets deleted, > so they wont be left as orphan records? > > Thanks, > > Jorge --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---
