I just need a php code which retrieves data from mysql and build a family tree.
Sql data has the following schema.
(Id, Name, ParentId1, ParentId2)
I'll insert the data as
INSERT INTO table_name (`Id`, `Name`, `ParentId1`, `ParentId2`)
VALUES ('100', 'Name_1', 'Parent_1', 'Parent_2')
If 0 is specified for parentId1 and ParentId2 then he is in top of the family. The code should generate the family tree based on the parentId1 and parentId2. Based on the matching parentId, name should attach to the parent. Optionally If I specify a relation between two example marriage, they should be connected in the code. Its ok if you just tell me an overview of how to design or approach.