Hi guys!
I’ve been trying for a while to display the Categories with their Subcategories and Items, but it seems impossible with my PHP knowledge. Your help will be really appreciate it!
My DB structure:
categories:
|id|name|description|parent_id|type|status|
-type: enum(‘general’,‘business’).
The leafs of ‘general’ type category are ‘articles’
The leafs of ‘business’ type category are ‘companies’
articles:
|id|title|content|parent_id|status|
companies:
|id|name|description|content|parent_id|status|
What I want to achieve:
About [type=general, parent_id=0]
[INDENT]Article1
Article2[/INDENT]
News [type=general, parent_id=0]
Category1
[INDENT][INDENT]Article1
Article2[/INDENT][/INDENT]
Category2
[INDENT]Article1[/INDENT]
Business Directory [type=business, parent_id=0]
Category1
[INDENT]Subcat1-1[/INDENT]
[INDENT][INDENT][INDENT]Company1
Company2
Company3[/INDENT][/INDENT][/INDENT]
[INDENT]Subcat1-2[/INDENT]
[INDENT][INDENT]Company1[/INDENT][/INDENT]
Category2
[INDENT]Subcat2-1[/INDENT]
[INDENT][INDENT]Company1[/INDENT][/INDENT]
[INDENT][INDENT]Company2[/INDENT][/INDENT]
[INDENT][INDENT]---------- and so on…[/INDENT][/INDENT]
Roadie