Page 1 of 1

Creating Family Tree Realtion using PHP and MySQL

Posted: Tue Jan 16, 2007 3:50 am
by jawa007
Hi Everybody,

I am on a project, where I have to display a Family Tree structure (A HIRERCHICAL structure). Primarily I have started with "Adjacency List Model" and also with the B-Tree PreOrder traversing. But Both concepts require a unique root and its corresponding children. But these concepts are not meeting with my client details.

As per my client details, there should be different node for MOTHER as well as for FATHER, and under these two nodes, their coressponding siblings(childrens) should be displayed(On the other hand, the B-Tree structure requires only one root(either MOTHER or FATHER) ).

Therefore, I am finding myself in trouble.

If somebody outhere can design or explain table structure in MySQL to overcome to this issue.

Thanks in advance.

Posted: Tue Jan 16, 2007 4:07 am
by CoderGoblin
Can't you use the "root" but just hide it as a root type (flag in the database ?). Any Route node would never be shown/processed.

Posted: Wed Jan 17, 2007 12:47 am
by jawa007
CoderGoblin wrote:Can't you use the "root" but just hide it as a root type (flag in the database ?). Any Route node would never be shown/processed.
Hi Goblin.

I will try with your given idea. But can u give me an idea how many relation(s) will it require to implement the above mentioned concept. As far as my knowledge, It will require 3 Relations(Tables).
[which is quite contrary to my client, that he is saying that it should be implement under one Relation, which I think its not going to be possible ].

Anyways Thanks, coming with more.

Bye.