thanks again 4 replying, as i told u before , i am using recursion for this operation, mysql_num_rows() is working fine when i use it without recursion, but when calling function inside itself, the mysql_num_rows() generates a value , which changes each time the function calls itself, this way we get a series of strings at the end of each loop, all i want to do is to add all these strings (numbers) inside an array or a static variable , but don't know how to do it. I really appreciate your help...
<?php
$i=10;// the list will show the downline for a member with id = 10
prin($i);// calling function prin
function prin($i) //definition
{
$id=$i;
$q=mysql_query("select id from f2_users where up_id='$id'");
$count= mysql_num_rows($q);// gives new value each time
while($r=mysql_fetch_row($q))
{
$i=$r[0];
echo $i;
echo "<br>";
prin($i); // recursion
}
}
?>