I am making a forum system for my site, however i am having problems with the level tree (i.e Level1 > Level2 > Level3 etc... ).
Basically by database layout looks like the following:
id Name parent
1 | Hardware | 0 |
2 | Web Design | 0 |
3 | Hard Drives | 1 |
4 | PHP & MySQL | 2 |
Now, say if i am currently in the 'PHP & MySQL' forum, the tree would be: 'Web Design > PHP & MySQL'.
The problem is, how do i make the 'Web Design > PHP & MySQL', from just knowing the id?
For example:
htttp://www.mysite.com/view_forum?id=4.
I know there is some loop involved, and possibly inputting the data into an array, thus:
array[1] > [array[2] > array[3] etc...
Any help would be massively appreciated, as ive been twiddling my thumbs over this one for quite some time!!
Thanks,
Jonathan