Hello,
I have two tables.
One table has 2 fields
categoryid, categoryname.
Table 2 has 3 fields
subcategoryid, subcategoryname, parentid.
Obviously table 2 is holding sub categories for table 1.
Question is how do I query this to show this data in this format.
Is this done on the MySQL side or PHP side? Really confused on this.
What is this called?
category name 1
-----------------sub cat1 (parent is 1)
-----------------sub cat2 (parent is 1)
-----------------sub cat 3 (parent is 1)
category name 2
-----------------sub cat4 (parent is 2)
-----------------sub cat5 (parent is 2)
Thanks!