How do automaticly delete rows from other tables
Whatever you are trying to do can easily be done by 

USING ON DELETE CASCADE AND ON UPDATE CASCADE(IF Required) 

While creating the foreign keys on your table.

For your reference have a look at FOREIGN KEY Constraints.