in reply to Re: Re: HTML::Template-Displaying DB Records-Still struggling
in thread HTML::Template-Displaying DB Records
I also tried fetchrow_hashref():<br> use Data:: Dumper; <br> print Dumper $dbh; <i>###This displays $VAR1 = bless( {}, 'DBI::db' +); -does this mean DB connection was established? (do need an answer +here)</i> <br> print $rows; <i>###This displays ARRAY(0x1ed0ad8)</i> <br> print Dumper $rows; <i>### This displays $VAR1 = []; which means the a +rray reference is empty-but why?</i> <br>
Same problem. Surprisingly, if you look at the code in my previous posts, I used selectcol_arrayref successfully in the retrieveFormData function so the DB connection seems to be fine. What could possibly be wrong?my $rows=[]; $sth = $dbh->prepare( $SQL ); $sth->execute(); push @{$rows}, $_ while $_ = $sth->fetchrow_hashref(); print Dumper $dbh; #Prints $VAR1 = bless( {}, 'DBI::db' ); print Dumper $sth;#Prints $VAR1 = bless( {}, 'DBI::st' ); print Dumper $rows; #Prints $VAR1 = [];
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: HTML::Template-Displaying DB Records-Still struggling
by perrin (Chancellor) on May 26, 2004 at 16:51 UTC |