I know there has to be enough logical minds in here to get me started on the right track.. I'm drawing a blank, and desparately need to get this worked out. Any clues would be greatly appreciated.
I am dealing with a 2 x infinity personal forced matrix, and need to be able to do a couple of things.
When a member reaches a total of 50 people in his downline without regard to balance between the legs, I need to know it so he can be paid.
Trouble is, the matrix could build evenly, in which case it would only take 4 1/2 levels to be filled to make this happen.
OR
The matrix could fill as a single file line one sponsoring another sponsoring another, etc.. in which case it would take 50 levels for this to happen.
What I'm having a problem with is trying to define an algorithm that will track the downline one level at a time, based on a field in their member record in the MySql DB table, like their matrix_ID.
In their member record would also be fields for their first level - 2 members ID's if they have filled those positions. Then I'd need those members records read, and the first level 2 members from each of their records, and so on..
I need to be able to work this both ways... from the top down when someone wants to see their downline... which would be rather simple, and from the bottom up, when someone new joins, to determine if that join is going to put someone upline at the 50 point.
If I sound confused... it is because I am.
😕
I've been trying to work this out in my mind and on paper for a week now, and continue to draw blanks...
Most likely some simple explanation and I'm trying to make it too difficult, but if someone could head me in the right direction, I'd appreciate it. Or tell me that my thinking is all wrong and start over again..
I really need help.
thanks in advance..
doug