php 怎样用循环得到一个用户下级及下下级,下下下级...的总人数
functionsubfl($uid,$num1){$result1=mysql_query("select*fromuserwherelid='".$uid."'");...
function subfl($uid,$num1){
$result1=mysql_query("select * from user where lid='".$uid."'");
echo "select * from user where lid='".$uid."'";
$num2=mysql_num_rows($result1)+$num1;
$num=$num2;
if($myrow1=mysql_fetch_array($result1)){
do {
$this->subfl($myrow1["id"],$num2);
}
while ($myrow1=mysql_fetch_array($result1));
}else{
$num1=$num2; 展开
$result1=mysql_query("select * from user where lid='".$uid."'");
echo "select * from user where lid='".$uid."'";
$num2=mysql_num_rows($result1)+$num1;
$num=$num2;
if($myrow1=mysql_fetch_array($result1)){
do {
$this->subfl($myrow1["id"],$num2);
}
while ($myrow1=mysql_fetch_array($result1));
}else{
$num1=$num2; 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询