i have problem putting value in array
<?
function catlist($id){
global $db,$title;
$title=array();
$result=$db->Execute("Select * from table where id='$id'");
while(!$result->EOF){
$title[]=array('name'=>$result->fields['name'], 'id'=>$result->fields['id']);
if($result->fields['up']==0) return $title;
else catlist($result->fields['up']);
$result->MoveNext();
}
}
catlist(8);
print(count($title));
it always print 1 but i know it has many results
but when i print out the $result->fields['name'] it works fine i don;t whats wrong in my code