Generating Depth based tree from Hierarchical Data in MySQL (no CTEs)
You can do it in a single call from php to mysql if you use a stored procedure: Example calls mysql> call category_hier(1); +——–+—————+—————+———————-+——-+ | cat_id | category_name | parent_cat_id | parent_category_name | depth | +——–+—————+—————+———————-+——-+ | 1 | Location | NULL | NULL | 0 | | 3 | USA | 1 | Location … Read more