in reply to Re: MySQL
in thread Filtering MySQL results

This is an excellent candidate for abstraction:

sub get_group { my ($dbh, $group) = @_; my $sth = $dbh->prepare( "SELECT username, password, group FROM users WHERE group = ?"); $sth->execute($group) or warn "Can't select on group: $DBI::errstr\n"; my @users = (); while( my $user = $sth->fetchrow_hashref()) { push @users, $user; } return @users; }

--
The hell with paco, vote for Erudil!
:wq