Remember that selectall_hashref changed in 1.20. Anyone who asks questions
about selectall_hashref needs to clarify which version of the DBI they're using.

Tim.

On Wed, Dec 19, 2001 at 09:38:32AM -0800, Wilson, Doug wrote:
> 
> > From: Janakiram Koka [mailto:[EMAIL PROTECTED]]
> > 
> > I am trying to get the selectall_hashref() method to work.  I 
> > have a table
> ....
> > my $matrix = $dbh->selectall_hashref("SELECT * FROM youthLeader");
> > print "value 2 = " . $matrix->[1]{fname} . "\n";
> 
> Check the DBI docs again, you don't really want the selectall_hashref
> method, you appear to want the selectall_arrayref method with
> a 'Slice' or 'Columns' attribute argument.
> 
> You are referencing $matrix as an array reference (albeit a reference to
> an array of hash references) which is what selectall_arrayref returns.
> selectall_hashref actually returns a reference to a hash (of hashes).
> 
> HTH,
> Douglas Wilson

Reply via email to