I assume this is a fairly common requirement for people when it comes to creating any application that uses sorting and displaying data in categories - any CMS / Forums / Carts, etc., and I tore my hair, trying to think about how to show all categories and their children to no avail - the best I have succeeded in is the while loop in the loop (although many levels, in my opinion, I can require), but this, in my opinion, is detrimental to programming. to be easily extensible.
So, considering:
Category 1
-Sub cat
-Sub cat
--Sub sub cat
-- Sub sub cat
-Sub cat
Category 2
-Sub cat
-Sub cat
--Sub sub cat
-sub cat
Category 3
-Sub cat
Database Fields: ParentIDS ID Name
How would you choose to echo each category in your hierarchy from the database?
, , , , .
, "" , . ?