data structure help needed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



hi all,

i am developing a site where users will be related in a parent-child type relationship.

my users table is like this:

id     |     user    |    parent
---------------------------------
1      |    joe       |    null
2      |    bill       |    null
3      |   fred      |    1
4      |   john     |    3
5     |   frank     |   3
etc.

Any user may have many children - what I want to do is traverse the tree in such a way that I can go up the family tree from any spot and see who is related.

Anyone know of a good tutorial or a point in the right direction? I think this will require some recursive statement, which I have not done in PHP or MySQL before.

Thanks
Charles


-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux