Hello. There is a table
CREATE TABLE IF NOT EXISTS `tb_category` ( `id` int(11) NOT NULL AUTO_INCREMENT, `id_parent` int(11) NOT NULL, `eng_title` varchar(255) NOT NULL, `title` varchar(255) NOT NULL, `image` varchar(63) NOT NULL, PRIMARY KEY (`id`), ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=6 ; I would like to add such a function that if an entry is deleted with id_parent = 0 (that is, the root), then all the child elements were also deleted, I read about ON DELETE CASCADE started to implement, but as I understood there you need to use 2 tables for this, and if I am all in the same table, what to do, because when I made this connection, I could no longer add records even if the table was empty? I have so far from thoughts only use 2 requests.