mukunthan Posted March 17, 2009 Share Posted March 17, 2009 Hi, I am doing a site on horses.My "horses " table consists of the following fields 1.id_horse ->primary key 2.horse 3.sex 4.id_father -> which references the primary key id_horse 5.id_father -> which references the primary key id_horse now i need to display the genealogy of a horse like a family tree. Can anyone please help to do it? eg., Black Colt ---------|--------- | | Sudden Blue Storm |-----------|---------| Seabiscuit Black Devil Link to comment https://forums.phpfreaks.com/topic/149812-generation-of-horses-in-tree-sturture/ Share on other sites More sharing options...
severndigital Posted March 17, 2009 Share Posted March 17, 2009 if you need to take a graphical approach ... you could use the GD image library to draw the lines or if you just need a straight breakdown you could also feed the horses into a list and control the formatting with CSS Link to comment https://forums.phpfreaks.com/topic/149812-generation-of-horses-in-tree-sturture/#findComment-786691 Share on other sites More sharing options...
otuatail Posted March 17, 2009 Share Posted March 17, 2009 You could use a self join with a field called parent Desmond. Link to comment https://forums.phpfreaks.com/topic/149812-generation-of-horses-in-tree-sturture/#findComment-786692 Share on other sites More sharing options...
mukunthan Posted March 17, 2009 Author Share Posted March 17, 2009 Hi Thanx, Can u pls tell me how to 1st list out the horses family tree recursively.There are lots of ancestors . I need to list them all in a tree format Link to comment https://forums.phpfreaks.com/topic/149812-generation-of-horses-in-tree-sturture/#findComment-786741 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.