problem generating family tree structure

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
amitsri
Forum Newbie
Posts: 14
Joined: Fri Aug 18, 2006 6:16 am

problem generating family tree structure

Post by amitsri »

hi friends,
i am the new member of this forum
i have been trying to generate a family tree
there may be 3 levels for each node. In the same level user can add siblings. and in the upper level there may user can add parents and in the lower level user can add child node. this may continue to n level for each node. this code should be able to interact with database. i dont understand how to approach this problem.please anyone can help
thanks in advance ,
amit
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Use XML
amitsri
Forum Newbie
Posts: 14
Joined: Fri Aug 18, 2006 6:16 am

cant follow

Post by amitsri »

plz can u make it clear with an example
User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Well I have a half-sister and that creates a real problem for using any nesting as a structure.
So I've decided this is probably the only robust way of doing it:

Code: Select all

<personIndex>
    <person name="Geoff" id="1" gender="m" />
    <person name="Pam" id="2" gender="f" />
    <person name="Viv" id="3" gender="f" />
    <person name="Oliver" id="4" parents="1 2" gender="m" />
    <person name="Bonnie" id="5" gender="f" parents="1 3" />
</personIndex>
amitsri
Forum Newbie
Posts: 14
Joined: Fri Aug 18, 2006 6:16 am

sorry problem

Post by amitsri »

i really cant get u i think u r not able to get my problem its not a parent child relationship
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Re: problem generating family tree structure

Post by volka »

eh, it's not?
amitsri wrote:and in the upper level there may user can add parents and in the lower level user can add child node.
Then what is it?
Post Reply