I've got various solution from SO to create my first MLM project, but now I got stuck in total down-line count (via recursive function), as I've no prior Idea on this, please anyone help me.
My Database Table structure is as below (table name member):
`member_id | member_name | node_left | node_right
where member's relation is as:
         member_id (Id 101)
               /\
              /  \
node_left(Id 102)  node_right(Id 103)
              /\                 /\
             /  \         blank /  \blank
(again) blank   node_right (104)
...... and so on. The above is just an example
`
Now I need to count total downline of any member. eg: suppose of above example, I want to know total downline of member_id 101 How to create the recursive function to do this which ends in finite loop ?
please give me any Idea..
 
     
     
    