我写了这样的PHP代码。根据我的代码,我只能获得3个级别。如何获得无限的父母和孩子的水平。?
$GetNetworkList=mysql_query("SELECT * FROM txuser INNER JOIN txtusernet ON txuser.UserDid=txtusernet.UserDid WHERE txtusernet.Status=0 AND txuser.SponsNo='$DisCode'");
while($FetchNetworkList=mysql_fetch_array($GetNetworkList)){
echo "L1-" . $FetchNetworkList['DistribCode'] ."<br/>";
$GetNetworkList1=mysql_query("SELECT * FROM txuser INNER JOIN txtusernet ON txuser.UserDid=txtusernet.UserDid WHERE txtusernet.Status=0 AND txuser.SponsNo='$FetchNetworkList[DistribCode]'");
while($FetchNetworkList1=mysql_fetch_array($GetNetworkList1)){
echo " L2-" . $FetchNetworkList1['DistribCode']."<br/>";
$GetNetworkList2=mysql_query("SELECT * FROM txuser INNER JOIN txtusernet ON txuser.UserDid=txtusernet.UserDid WHERE txtusernet.Status=0 AND txuser.SponsNo='$FetchNetworkList1[DistribCode]'");
while($FetchNetworkList2=mysql_fetch_array($GetNetworkList2)){
echo "L3-" . $FetchNetworkList2['DistribCode']."<br/>";
}
}
}
L1-9400013
L2-9400014
L3-9400015
L2-9400732
L3-9400733
L3-9401377
L1-9400012
L2-9400016
L3-9400155
L1-9400019