heya,
let's see where to start...
someone told me I should use a simple MySQL table for storing my category structure, so that it is flexible and easy to control.
my table is:
cat_id, sub_id
the sub_id always contains the cat_id of the category which is one level above the category which is refering to it...
e.g. if I have the category "Dog" with the cat_id = 1 and I have the category "Dog Food" within "Dog" with the cat_id = 2 and the sub_id = 1, then "Dog Cups" within "Dog Food" and the cat_id = 3, sub_id = 2 and so on ...
what I'm up to is how can I get a page to display all articles within "Dog" when I click on its level but display only the particular articles within "Dog Food" when I click deeper into the structure?
also how do I get all the cat_id's below "Dog" into my array? let's say there's another group "Dog Items" within "Dog" with cat_id = 4, sub_id = 1 and I'd like to have all cat_id's named above based upon the depth level im in?
Hope my try on explaining this is not too confusing...
I'm using an array which stores the cat_id's in the right order... or at least it should but however it doesn't work...
let's see where to start...
someone told me I should use a simple MySQL table for storing my category structure, so that it is flexible and easy to control.
my table is:
cat_id, sub_id
the sub_id always contains the cat_id of the category which is one level above the category which is refering to it...
e.g. if I have the category "Dog" with the cat_id = 1 and I have the category "Dog Food" within "Dog" with the cat_id = 2 and the sub_id = 1, then "Dog Cups" within "Dog Food" and the cat_id = 3, sub_id = 2 and so on ...
what I'm up to is how can I get a page to display all articles within "Dog" when I click on its level but display only the particular articles within "Dog Food" when I click deeper into the structure?
also how do I get all the cat_id's below "Dog" into my array? let's say there's another group "Dog Items" within "Dog" with cat_id = 4, sub_id = 1 and I'd like to have all cat_id's named above based upon the depth level im in?
Hope my try on explaining this is not too confusing...
I'm using an array which stores the cat_id's in the right order... or at least it should but however it doesn't work...