Thanks. I tried Data::Dumper and here's the output:
<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>
I also tried fetchrow_hashref():
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 = [];
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?

In reply to Re: Re: Re: HTML::Template-Displaying DB Records-Still struggling by thisisperl
in thread HTML::Template-Displaying DB Records by thisisperl

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.