Hello guys, I am a new learner in PHP and I am modifying a simple binary site.
I am here to ask help how can I calculate my downline pairs or the total left and right side of
Here is the example of my tables in database:
+++++++++++++++++++++++++++++++++ | childID | parentID | position + +++++++++++++++++++++++++++++++++ | Admin | NULL | NULL + | First | Admin | lft + | Second | Admin | rgt + | Third | First | lft + | Fourth | First | rgt + | Fift | Second | lft + | Six | Second | rgt + | Sevent | Third | lft + | Eight | Third | rgt + | Ninth | Fourth | lft + | Tenth | Fifth | rgt +
I have three tables consist of childID or their username, parentID or their Sponsors/Referral, and
position for their position which is lft(left) and rgt(right).
What I am planning to do is, I want to show the user (or childID) their
total left(lft) and right(rgt) downlines.
For example, I want to get the total of all downlines of the childID (First) from left and right
base on my table structure and show it to the user (First).
Hope someone can help me about this. Thanks in advance.