thara Posted October 10, 2015 Share Posted October 10, 2015 (edited) I have a mysql table named categories. This is how my categories looks like: mysql> select * from categories; +-------------+--------+----------------------+-------------+ | category_id | parent | name | description | +-------------+--------+----------------------+-------------+ | 1 | NULL | Products | NULL | | 2 | 1 | Computers | NULL | | 3 | 2 | Laptops | NULL | | 4 | 2 | Desktop Computers | NULL | | 5 | 2 | Tab PCs | NULL | | 6 | 2 | CRT Monitors | NULL | | 7 | 2 | LCD Monitors | NULL | | 8 | 2 | LED Monitors | NULL | | 9 | 1 | Mobile Phones | NULL | | 10 | 9 | LG Phone | NULL | | 11 | 9 | Anroid Phone | NULL | | 12 | 9 | Windows Mobile | NULL | | 13 | 9 | iPad | NULL | | 14 | 9 | Samsung Galaxy | NULL | | 15 | 1 | Digital Cameras | NULL | | 16 | 1 | Printers and Toners | NULL | | 22 | 1 | Computer Accessaries | NULL | | 23 | 22 | USB Cables | NULL | | 24 | 22 | Network Cables | NULL | +-------------+--------+----------------------+-------------+ 24 rows in set (0.00 sec) So now I need to display these category and sub categories in a HTML table. I have attached an image with the table layout which is I expect. Can anybody tell me is it possible to do in php? Thank you. Edited October 10, 2015 by thara Link to comment https://forums.phpfreaks.com/topic/298518-display-hierarchical-data-in-html-table/ Share on other sites More sharing options...
benanamen Posted October 10, 2015 Share Posted October 10, 2015 ATTN: Moderator DUPLICATE POST OF http://forums.phpfreaks.com/topic/298507-creating-a-sub-and-sub-sub-menu-using-category-and-sub-categories/ @thara, Do not start a new thread on the same subject. Link to comment https://forums.phpfreaks.com/topic/298518-display-hierarchical-data-in-html-table/#findComment-1522885 Share on other sites More sharing options...
Ch0cu3r Posted October 10, 2015 Share Posted October 10, 2015 Agreed. Topic Locked please refer to to your other topic. Link to comment https://forums.phpfreaks.com/topic/298518-display-hierarchical-data-in-html-table/#findComment-1522888 Share on other sites More sharing options...
Recommended Posts