I have no idea what you are starting with or what you want to finish with, so here is general method of dealing with a hierarchy. category table +--------+-----------+--------+ | cat_id | catname | parent | +--------+-----------+--------+ | 1 | Cat 1 | 0 | | 2 | Cat 2 | 0 | | 3 | Cat 3 | 0 | | 4 | Cat 1 1 | 1 | | 5 | Cat 1 2 | 1 | | 6 | Cat 2 1 | 2 | | 7 | Cat 2 2 | 2 | | 8 | Cat 2 3 |
    • Like
    1