i am having a bit of trouble.
i have the following tables
Categories
+--------+------------+
| ID | name |
+--------+------------+
| 1 | Accommodation |
| 2 | Advertising |
| 3 | Architects |
+--------+------------+
Classifications
+--------+--------------------------+
| ID | category_id | name |
+--------+--------------------------+
| 1 | 1 | Hotels |
| 2 | 1 | Lodge |
| 3 | 2 | Ad Agency |
| 3 | 2 | Architects Supplies |
+--------+--------------------------+
Business
+--------+--------------------------+
| ID | classification_id | name |
+--------+--------------------------+
| 1 | 1 | 123 Hotel |
| 2 | 1 | ABCLodge |
| 3 | 2 | XYZAd Agency |
+--------+--------------------------+
How can i display a side menu like this
Accommodation
- Hotels
- Lodge
Advertising
- Ad Agency
but it should only contain categories/classifications if there is an entry in the business table that uses it, meaning "Architects- architects supplies" should not appear.
Any help would be appreciated.