note 105276 deleted from language.functions by danbrown

From: Date: Sun, 07 Aug 2011 15:38:06 +0000
Subject: note 105276 deleted from language.functions by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-182297@lists.php.net to get a copy of this message
Note Submitter: haren at najupal dot com ---- Can any one tell me that what should I use in my function below. I want to get left right total downline of a special ID. coloum left contains left downline id and coloum right contain right downline id. MLM Binary plan. <?php //My Codes============ class data{ function countchild($id, $mid){ $sql=mysql_fetch_row(mysql_query("SELECT right FROM member_login WHERE id='$id'")); if($sql['0'] >'0'){ $this->nodel($sql['0'], $mid=1); } else echo "0"; } function nodel($id, $mid){ $sql=mysql_fetch_row(mysql_query("SELECT left,right FROM member_login WHERE id='$id' and (left > '0' or right > '0')")); if($sql['0'] > 0 && $sql['1']>0){ $mid=$mid+2; } elseif($sql['0'] > 0 or $sql['1']>0){ $mid=$mid+1; } if($sql['0'] <= 0 && $sql['1'] <= 0) { echo $mid; } function noder($id, $mid){ $sql=mysql_fetch_row(mysql_query("SELECT left,right FROM member_login WHERE id='$id' and (left > 0 or right > 0)")); if($sql['0'] >'0' && $sql['1'] >'0') { $mid=$mid+1; } elseif($sql['0'] >'0' or $sql['1'] >'0'){ $mid=$mid+2; } if($sql['1'] >'0'){ $this->noder($sql['1'], $mid); } else { echo $mid+1; } } } } $data=new data; echo $data->countchild('1', '0')."<br>"; ?>

« previous php.notes (#182297) next »