Ok, I'm not seeing why this doesn't work, perhaps one of you gent's can help me out.
$new_upline = RetrieveUpline($root_referral_id, array());
echo ("The upline after return: <BR>");
var_dump ($new_upline);
function RetrieveUpline($root_ref_id, $upline){
$referrer = mysql_query("SELECT id, username, referral_ID, total_points_earned, isbanned FROM members WHERE id = ".$root_ref_id);
$rows = mysql_num_rows($referrer);
$upline_size = count($upline);
if ($rows>0){
while($feed = mysql_fetch_array($referrer, MYSQL_ASSOC)){
$upline[$upline_size] = $feed;
RetrieveUpline($upline[$upline_size]['referral_ID'], $upline);
}
}else{
echo ("The upline before return: <BR>");
var_dump($upline);
return $upline;
}
}
The var_dump inside the function works as expected. The return just returns nothing, even if I set it to raw text. I know it's probably something easy, but I'm burnt out on is right now.
if
branch – knittl Apr 20 '12 at 15:41