in reply to RE: References of Eternal Peril (while we're on the subject)
in thread References of Eternal Peril
to this:my $x = 0; my @ar = (); while ( my $hr = $sth->fetchrow_hashref() ) { $ar[$x++] = $hr; } $s->rows = $x; $s->ar = \@ar;
But I think there's a "fetchall_hashref" or something like that that could do this all in one fell swoop. Durn. Not enough window space on this speaker-lounge-area dumb PC to go looking up "man DBI". Sorry.my @ar = (); while (my $hr = $sth->fetchrow_hashref() ) { push @ar, $hr; } $s->ar = \@ar; $s->rows = @ar;
-- Randal L. Schwartz, Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: RE: References of Eternal Peril (while we're on the subject)
by DrManhattan (Chaplain) on Aug 11, 2000 at 19:01 UTC | |
by rdw (Curate) on Aug 11, 2000 at 21:59 UTC |