I have table 'children' with column id, name. the table store information about a father's children. this father has great grand children. I want to pick a particular child and display his children, grand children, great grand children in a family tree. Please help me out
Recursivity will help you on this. Do a search on this forum, I have posted something fairly similar In short you have a function that takes an Id as parameter like so: function getChildren ($id) { $sql = "SELECT * FROM children WHERE father_id = $id"; foreach of the children { echo $child['name']; getChildren ($child['id']); } } Code (markup): This is pseudo-code heh but should point you in the right direction aXe