![]() |
Categories and subcategories
Am currently working on a hack which would require the use of subcategories.
How can I go about with this ? As it is , the sql end has a table for the categories. Need I create another table for subcategories ? Am pretty lost as to where to begin. Any help would be most appreciated. |
The best way to do this is to add a new colum to the categories table called 'parentid'. 'parentid' will contain the id of the of the categorie your sub-cat belongs to.
|
You need to do some reading about recursive functions. I had to do this for my [top secret] project I'm working on but I did it but I have no idea how it works ;) Basically when you make your function youc all the function within it but that's essential to learning how to do this kind of thing :)
|
Quote:
But even then I do not quite see how they can be used for sub cats ... could you elaborate further ? :) Quote:
What happens if a cat is not a subcat, ie a parent category ? Sorry but am pretty new to this :o |
Set it to something like '0' by default when they are created if they are not a sub-cat.
|
What brad said ^^ (I use -1 for some odd reason though) :)
|
All times are GMT. The time now is 06:04 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|