$sth->execute(user) or die $db->errstr; $user_info = $sth->fetchall_arrayref(); foreach $info (@{client_info}) { $usr_info[0] = $info->[0]; ... (to [6]) } $num_rows = $sth->rows; return (@usr_info, $num_rows); #### print "Rows = ".$num_rows."\n"; foreach $info (@usr_info) { print "Info = ".$info."\n"; } /code>

I got the following output:

Row = Info = user A ... (to 6) Info = 1