Thread post-processing fetchall_arrayref: DBI (15 answers)
Opened by Gast at 2005-01-25 22:45

renee
 2005-01-26 09:39
#32892 #32892
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Code: (dl )
1
2
3
4
5
6
7
8
9
10
$sth=$dbh->prepare(qq{select id, quotient from ergebnis order by id});
$sth->execute();
my $array_ref=$sth->fetchall_arrayref();
my %hash;
foreach my $row (@$array_ref) {
#split the row
my ($id, $quotient) = @$row;
$hash{$id} += $quotient;
print "$id\t$quotient\n";
}
\n\n

<!--EDIT|renee|1106725197-->
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread post-processing fetchall_arrayref: DBI