+ Reply to Thread
Results 1 to 7 of 7

Thread: Making a tree diagram with PHP

  1. #1
    ComputerGen's Avatar
    ComputerGen is offline PC Mechanix Networks ComputerGen is on a distinguished road
    Join Date
    May 2005
    Posts
    106
    Rep Power
    8

    Making a tree diagram with PHP

    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?

  2. #2
    YoungCoder's Avatar
    YoungCoder is offline Founder YoungCoder has much to be proud of YoungCoder has much to be proud of YoungCoder has much to be proud of YoungCoder has much to be proud of YoungCoder has much to be proud of YoungCoder has much to be proud of YoungCoder has much to be proud of YoungCoder has much to be proud of
    Join Date
    Aug 2004
    Location
    Bournemouth, UK
    Posts
    2,334
    Rep Power
    21

    Re: Making a tree diagram with PHP

    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.

  3. #3
    cmwslw's Avatar
    cmwslw is offline X-treme G33K cmwslw is on a distinguished road
    Join Date
    Aug 2005
    Location
    Chattanooga
    Age
    19
    Posts
    61
    Rep Power
    8

    Re: Making a tree diagram with PHP

    Do you mean visually?
    Or scriptly?

  4. #4
    Mitch's Avatar
    Mitch is offline Banned Mitch will become famous soon enough Mitch will become famous soon enough
    Join Date
    Dec 2004
    Location
    United Kingdom
    Age
    24
    Posts
    2,481
    Rep Power
    0

    Re: Making a tree diagram with PHP

    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..

  5. #5
    cmwslw's Avatar
    cmwslw is offline X-treme G33K cmwslw is on a distinguished road
    Join Date
    Aug 2005
    Location
    Chattanooga
    Age
    19
    Posts
    61
    Rep Power
    8

    Re: Making a tree diagram with PHP

    OHHHH!! I thought he meant a family tree like thing.

    Nevermind.

    Silly me.

    :blushing:

  6. #6
    AgentGreasy is offline Accomplished Graduate Student AgentGreasy is on a distinguished road
    Join Date
    Jun 2005
    Location
    San Antonio, TX
    Age
    26
    Posts
    401
    Rep Power
    8

    Re: Making a tree diagram with PHP

    Quote ComputerGen originally posted:
    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?

    Well, you take what YC told you, and put it in a loop, and output it like:

    (link) > (link) > (link) .... etc.

  7. #7
    Zer0's Avatar
    Zer0 is offline A Toddler - Don't be Fooled! Zer0 is on a distinguished road
    Join Date
    Oct 2004
    Location
    PHP Heaven
    Posts
    26
    Rep Power
    0

    Re: Making a tree diagram with PHP

    PHP Code:
    $tree "";
    $parent mysql_query(______________________);
    while (
    $par mysql_fetch_array($parent))
    {
      
    $tree " > " $par['name] . $tree;
    }
    $tree = "Home". $tree; 

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. What is PHP?
    By wizard in forum PHP Articles
    Replies: 7
    Last Post: 4 Weeks Ago, 02:24 AM
  2. PHP Tutorial for beginners
    By YoungCoder in forum PHP Articles
    Replies: 19
    Last Post: 04-23-2006, 02:31 PM
  3. Php Syntax
    By wizard in forum PHP Articles
    Replies: 1
    Last Post: 10-06-2005, 01:53 AM
  4. Downloading and Installing PHP and Apache
    By bigdude in forum Articles, Tutorials, and Guides
    Replies: 0
    Last Post: 04-02-2005, 08:30 PM
  5. PHP Manual [Chris's Version]
    By Chrishasfun in forum PHP Articles
    Replies: 0
    Last Post: 01-02-2005, 02:22 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts