Re: [PHP] Method for displaying Downline
Daren -- ...and then Daren Cotter said... % % I need to display an entire downline (info about all % members referred by another member). The query to ... % The output I need is something like: % % 7 %10 11 %14 16 18 20 % 26 28 31 34 36 38 41 44 % % Where 7 referred 10 and 11, 10 referred 14 and 16, 14 ... % % I know some sort of looping (possibly recursion?) That depends on how you have your tables structures. This is a perfect opportunity for a binary tree, which is also easy to traverse. How is the data stored? % structure is needed, but I can't figure out how to % display the output in tables as shown above. See if you can live with something like 7 10 11 14 16 18 20 26 28 31 34 36 38 41 44 and then go from there. That's trivial. If that won't work, then you can calculate the number of cells you'll have to have running across the table as 2n+1, where n is the referral depth, and then calculate the position based on what level and what path. % % Any help would be greatly appreciated! HTH & HAND :-D -- David T-G * There is too much animal courage in (play) [EMAIL PROTECTED] * society and not sufficient moral courage. (work) [EMAIL PROTECTED] -- Mary Baker Eddy, "Science and Health" http://www.justpickone.org/davidtg/Shpx gur Pbzzhavpngvbaf Qrprapl Npg! msg87970/pgp0.pgp Description: PGP signature
Re: [PHP] Method for displaying Downline
IT IS CONSIDERED VERY RUDE TO SPAM THE LIST WITH REPEATED MESSAGES ONE IS ENOUGH!! Yes, I am shouting. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Method for displaying Downline
At 06:47 PM 11/29/02 -0800, Daren Cotter wrote: Must you send three separate requests to the list? One is enough. You might find some useful information here: http://marc.theaimsgroup.com/?l=php-general&m=95423103630080&w=2 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Method for displaying Downline
I need to display an entire downline (info about all members referred by another member). The query to actually get the info I need is fairly simple, but displaying it in a table is what's tripping me up. There are two tables: Affiliates and Referrals. Affiliates keeps track of all affiliate info. Referrals keeps track of who referred who (AffID and ReferredBy fields). The output I need is something like: 7 10 11 14 16 18 20 26 28 31 34 36 38 41 44 Where 7 referred 10 and 11, 10 referred 14 and 16, 14 referred 26 and 28, etc. Each member can only refer two others. I know some sort of looping (possibly recursion?) structure is needed, but I can't figure out how to display the output in tables as shown above. Any help would be greatly appreciated! __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Method for displaying Downline
I need to display an entire downline (info about all members referred by another member). The query to actually get the info I need is fairly simple, but displaying it in a table is what's tripping me up. There are two tables: Affiliates and Referrals. Affiliates keeps track of all affiliate info. Referrals keeps track of who referred who (AffID and ReferredBy fields). The output I need is something like: 7 10 11 14 16 18 20 26 28 31 34 36 38 41 44 Where 7 referred 10 and 11, 10 referred 14 and 16, 14 referred 26 and 28, etc. Each member can only refer two others. I know some sort of looping (possibly recursion?) structure is needed, but I can't figure out how to display the output in tables as shown above. Any help would be greatly appreciated! __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Method for displaying downline
I need to display an entire downline (info about all members referred by another member). The query to actually get the info I need is fairly simple, but displaying it in a table is what's tripping me up. There are two tables: Affiliates and Referrals. Affiliates keeps track of all affiliate info. Referrals keeps track of who referred who (AffID and ReferredBy fields). The output I need is something like: 7 10 11 14 16 18 20 26 28 31 34 36 38 41 44 Where 7 referred 10 and 11, 10 referred 14 and 16, 14 referred 26 and 28, etc. Each member can only refer two others. I know some sort of looping (possibly recursion?) structure is needed, but I can't figure out how to display the output in tables as shown above. Any help would be greatly appreciated! __ Do you Yahoo!? Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php