This looks great. Thanks... exactly what I was after.
- Charles
On Sunday, May 4, 2003, at 11:32 AM, Cal Evans wrote:
http://searchdatabase.techtarget.com/tip/ 1,289483,sid13_gci801943,00.html
Similar situation in the tutorial, it's an org chart.
=C=
* Cal Evans
* http://www.christianperformer.com
* Stay plugged into your audience
* The measure of a programmer is not the number of lines of code he writes
but the number of lines he does not have to write.
----- Original Message ----- From: "Charles Kline" <ckline@rightcode.net> To: <php-db@lists.php.net> Sent: Sunday, May 04, 2003 10:30 AM Subject: data structure help needed
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
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php