Yes me and a few people are making a forum system and are in desperate need on how to make a tree diagram with PHP!
Like that^?
Any help?
Yes me and a few people are making a forum system and are in desperate need on how to make a tree diagram with PHP!
Like that^?
Any help?
Basically each page has a parentid, in this case:
Page: Post New thread
Parentid: 11 (the php forum id)
Page: PHP Programming
Parentid: 10 (the web programming forum id)
And before that is just a link to the home page.
As long as the parent id's are in the mysql database with each page, you can easily create a tree from it.
Do you mean visually?
Or scriptly?
What do you mean 'scriptly' or visually?
The ids are found in the database as yc said. Once you have the ids of each of the forums on your message board you can use it to make a tree depending on where you are on the website..
OHHHH!! I thought he meant a family tree like thing.
Nevermind.
Silly me.
:blushing:
ComputerGen originally posted:
Well, you take what YC told you, and put it in a loop, and output it like:
(link) > (link) > (link) .... etc.
PHP Code:$tree = "";
$parent = mysql_query(______________________);
while ($par = mysql_fetch_array($parent))
{
$tree = " > " . $par['name] . $tree;
}
$tree = "Home". $tree;
There are currently 1 users browsing this thread. (0 members and 1 guests)