Hoping someone can point out my more than likely simple mistake here...

function getBranchArray($desig,$branchArray){
$arrayResult = mysql_query("SELECT up FROM categories WHERE designator
LIKE '$desig'");
while ($arrayRow = mysql_fetch_array($arrayResult)){
$up = $arrayRow["up"];
}
if($up != "TOP"){
$branchArray[]=$up;
getBranchArray($up,$branchArray);
}
****A print call to $branchArray here will print the array, complete*******
return $branchArray;
}

************This is what calls it*************

if(isset($which)){
$thisArray = array();
$branchArray = getBranchArray($which,$thisArray);
************A print call here shows that only the last value assigned in
getBranchArray gets passed*******
}

My question is, how do I get the array from getBranchArray to the variable
$branchArray? (I know I am missing something simple, but it's late...)