Downline points

Hi all,
I have a chain system which gives 5 points if 1 member is joined at right level and 1 at left level.i am maintaining a field called left_level and right_level in database to store the total number of members at the levels respectively.till this point it works fine, but when it comes to distribution of points, i dont know what to do to determine the valid pairs from both arrays.
for example, if at right level, their are 4 members, and at left level there is 1 member, qualifying pair is 1 and user will get 5 points.

can anyone help me in this regard??:frowning:

im sorry, but could you post some code because i don’t think i understand your question exactly

Yes sure.

$query=mysql_query("SELECT Left_level FROM tbl_treeview WHERE  ID='".$_SESSION['adminid']."'");

$query=mysql_query("SELECT Right_level FROM tbl_treeview WHERE ID='".$_SESSION['adminid']."'");

Here I am getting members of right level & left level respectively.
Again, for example,
qualifying pair is 1 and the sponsor of this id will get 5 points if there is member at the right level and at the left level.

I want to check that how many pairs are there who actually qualify for the points.and dont have idea how i can do this :frowning: