bapi Posted October 31, 2007 Share Posted October 31, 2007 hi, i want to display some information in formate of 1 -> 3->9 ......... I have site in which in need to display list of people in chain. That mean that a person have chain of peoples below him. like 1 1 2 3 1 2 3 1 2 3 1 2 3 ..................................... Now, how can i display all the members present below "1" in one page. Any help will be great full Link to comment https://forums.phpfreaks.com/topic/75483-help-in-displaying-data/ Share on other sites More sharing options...
bache Posted October 31, 2007 Share Posted October 31, 2007 How do you get your data and how it is organised? Link to comment https://forums.phpfreaks.com/topic/75483-help-in-displaying-data/#findComment-381820 Share on other sites More sharing options...
bapi Posted October 31, 2007 Author Share Posted October 31, 2007 Well i m using MYSQL and PHP. With Table in this formate. idx username userid underuserid Link to comment https://forums.phpfreaks.com/topic/75483-help-in-displaying-data/#findComment-381822 Share on other sites More sharing options...
bache Posted October 31, 2007 Share Posted October 31, 2007 Try with recursion, for example function display_childs($id) { // here goes a function to get array and print all the childs of $id if it has childs, if it hasn't - return. // after that for every child of $id you call function display_childs() //for example: foreach($childs as $key=>$value) function display_childs($value); } Link to comment https://forums.phpfreaks.com/topic/75483-help-in-displaying-data/#findComment-381833 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.