get the next array group in array
===

i have a problem with a class i have an array with all the results of a query search, my problem is that i need to select one array from these array, and then be able to select the next array or the prev array.

here is my code

    function getUserProf(array $data, $faceid)
    {
        //make sure that all data is saved in an array
    	$userprof = array();
    	
    	//makes the array with the info we need
        foreach ($data as $val)
    		if ($val['faceid'] == $faceid){
    			$userprof = array ("id" => $val["id"], "total" => $val["total"], "faceid" => $val["faceid"], "lname" => $val["lname"], "fname" => $val["fname"], "hand" => $val["hand"], "shot1" => $val["shot1"], "shot1" => $val["shot1"], "shot2" => $val["shot2"], "shot3" => $val["shot3"], "shot4" => $val["shot4"], "shot5" => $val["shot5"]);
    		}
    		$next = next($data);//to get the next profile
    		$prev = prev($data);//to get the next profile
    		$userprofinfo = array('userprof' => $userprof, 'next' => $next);//make a array with the profile and the next prof and the prev prof
    		
    	//we return an array with the info
        return $userprofinfo;
    }

can you please help me?? these works but i wont give me the exact next array group.