Hi there,
I'm a bit confused over this one...
I'm making a forum for my website that contains different levels, for example:
Forums > Operating Systems > Windows XP > XP Proffessional
That side is all going well, basically for the forum listings i have 1 table containing:
a. the name of the forum.
b. the forums parent id.
c. the level of the forum (i.e Operating Systems would be level 1, Windows XP is level 2, XP Proffessional would be level 3).
I have the browse functionality up and running, however i cannot get the 'Forums > Operating Systems > Windows XP > XP Proffessional' tree to work!!
For example, an example extract from my table is:
operating systems - Parent ID = (Blank), Level 0.
Windows XP > Parent ID = 20, Level 1.
XP Professional > Parent ID = 21, Level 2.
Basically, i need some sort of loop which will read back through the parent IDs. For example:
if the parent id is 21:
[url]http://www.***.com/vie_forums.php?forum_id=21[/url]
i need to extract the $name of id 21 from the database and input it into a variable.
look at that rows parent ID, and print that name into a variable.
look at that rows parent ID, and print that name into a variable.
etc etc etc, until the parent id is blank.
then print the tree:
forums > $variable[1] > $variable[2] $variable[3] > etc....
I'm not sure if anybody gets what im saying, but a bit of input would really be helpful and much appreciated!
Many Thanks,
Jonathan