in reply to Getting MySQL Data into an Array.

Try this:

@companies = map { $_->[0] } @{$dbh->selectall_arrayref('SELECT compan +y FROM company_public')};

--
Tatsuhiko Miyagawa
miyagawa@cpan.org

Replies are listed 'Best First'.
Re: Re: Getting MySQL Data into an Array.
by Anonymous Monk on Jan 06, 2002 at 23:37 UTC
    Wow... that is very neat.
Re: Re: Getting MySQL Data into an Array.
by cdherold (Monk) on Jan 07, 2002 at 08:34 UTC
    thanks for opening my mind. that's a cool one.
      Yes, that is indeed cool, but don't let your boss catch you using that. DBI has a method that will return a column for you:
      my @companies = @{$dbh->selectcol_arrayref(' SELECT company FROM company_public ')};

      jeffa

      L-LL-L--L-LL-L--L-LL-L--
      -R--R-RR-R--R-RR-R--R-RR
      F--F--F--F--F--F--F--F--
      (the triplet paradiddle)