Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: pushing individual rows of return (DBI) into seperate arrays

by tcf22 (Priest)
on Aug 28, 2003 at 19:58 UTC ( #287510=note: print w/replies, xml ) Need Help??


in reply to pushing individual rows of return (DBI) into seperate arrays

Why not just use an array of arrays.
$sth->execute() or die $sth->errstr; my @result_arrays; while (my @result = $sth->fetchrow_array()) { push(@result_arrays, \@results); } foreach(@results_arrays){ print qq(@{$_}<br><br>); } $sth->finish();

Replies are listed 'Best First'.
•Re: Re: pushing individual rows of return (DBI) into seperate arrays
by merlyn (Sage) on Aug 29, 2003 at 13:51 UTC
    And then, why not use the built-in tool to do that:
    $sth->execute; # I always set RaiseError so I don't have to keep sayin +g "or die..." my $result = $sth->fetchall_arrayref(); # calls ->finish too for (@$result) { print qq{@$_<br><br>}; }

    -- Randal L. Schwartz, Perl hacker
    Be sure to read my standard disclaimer if this is a reply.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://287510]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (6)
As of 2021-06-17 22:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What does the "s" stand for in "perls"? (Whence perls)












    Results (86 votes). Check out past polls.

    Notices?