PHP MySQL Delete parent and child rows
问题 I have 1 MySQL Table. It looks like this: +---------+-------------+--------+ | item_id | parent_id | Name | +---------+-------------+--------+ | 1 | 0 | Home | +---------+-------------+--------+ | 2 | 1 | Sub | +---------+-------------+--------+ | 3 | 2 | SubSub | +---------+-------------+--------+ If I DELETE item_id 1, I want to delete the rest of the sub also but how can I do it? I have tried the Foreign Key but it works only if you have 2 tables?? I hope someone can help me in MySQL maybe