I have a database structure that stores categories
There is a table that holds the information of the cateogries ID and if it has a Parent ID
eg. categories_id = 34 parent_id = 5
If it is a top level category it has a parent_id of 0
So when displaying we can always see the next level down by seeing what that level has as a parent.
What I am trying to figure out is, how can I loop through all the possible children of a parent category.
so if I start with parent_id = 5, categories_id = 34 would be a child category but it is also the parent of categories_id = 45
I have tried thinking of various ways but can't seem to come up with a solution. I am no expert so any help would be appreciated.
Let me know if I havent explained this clearly enough please
Thankyou