in reply to Fetchrow_hash/array question with DBI/Perl
It isn't clear what you want to achieve.
If you want a list of arrays, then use
. If you want a list of hashes, then usemy $lol = $sth_m->fetchall_arrayref()
(notice the empty hash ref passed as an argument).my $loh = $sth_m->fetchall_arrayref({});
In both cases, you get an array ref containing either hashes or arrays,a nd you can loop through the results.
Have a look at DBI Recipes for some more examples and explanations.
As a side note, you are using $results->{'company'}, but there is no 'company' column in your query.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Fetchrow_hash/array question with DBI/Perl
by perleager (Pilgrim) on Mar 20, 2004 at 21:56 UTC |