while (my $pointer = $sth->fetchrow_hashref) { $c++; $account_name = $pointer->{'account_name'}; $username = $pointer->{'username'}; print "$c - $account_name = $username; #if I print this here it could return something like: =code 1 - Group A = John 2 - Group A = Mary 3 - Group A = Joe 4 - Group A = Ann 5 - Group A = Carl 6 - Group A = Joen 1 - Group B = Maria 1 - Group C = Junior 2 - Group C = Eva 3 - Group C = Mario 4 - Group C = Raimund 5 - Group C = Gerald 6 - Group C = Jasmin 7 - Group C = Rose 8 - Group C = Suelly # I have to find a way to whatever comes from my db query to be # separated by the group so later I could use on my program: # could be something like: push @array1 = all Group A and usernames and so forth... =cut }