I'm getting this error:
DBI fetchall_hashref: invalid number of parameters: handle + 0
Usage: $h->fetchall_hashref() at test_xsl.cgi line 59.
when I try to use fetchall_hashref .
code sample:
....$dbh code snipped ...
my $sql=qq{select col1,col2 from some_table};
my $sth=$dbh->prepare($sql);
$sth->execute() || die "no execute $DBI::errstr\n";
$tbl_ary_ref = $sth->fetchall_hashref; # error here
....
What have I missed? The DBI docs don't have much to say about
fetchall_hashref. I take it that $table_ary_ref is an array of hashes
and I can do this later ???:
foreach my $row($tbl_ary_ref){
my %arow=%$row;
print qq{<div>$arow{col1} $arow{col2}</div>};
}
Jeff