Please help me for tree like structure

Discussion in 'PHP' started by Om ji Kesharwani, Dec 28, 2009.

  1. #1
    I am having multi-level category and i want to define path like:
    Digital Point Forums > Design & Development > Programming > PHP
    as like in this forum.
    Please provide me any tutorial or help.
    Thanks
     
    Om ji Kesharwani, Dec 28, 2009 IP
  2. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Assuming you have all your categories with parent ID's you simply start at the category and work your way back based on the ID and parent id until you find a category which doesnt have a parent id or it's 0 (a top level category)
     
    JAY6390, Dec 28, 2009 IP
  3. Om ji Kesharwani

    Om ji Kesharwani Peon

    Messages:
    211
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I can do it by using GET method to some extend.
    The problem is how to store ids to unlimited depth
    Is there any function in php to store previous page id or content?
     
    Om ji Kesharwani, Dec 28, 2009 IP
  4. JAY6390

    JAY6390 Peon

    Messages:
    918
    Likes Received:
    31
    Best Answers:
    0
    Trophy Points:
    0
    #4
    you could use a session variable,

    You can have unlimited parents and children for categories. You just need two values, the id and the parent id, and work your way backwards from the category of choice
     
    JAY6390, Dec 28, 2009 IP