Alright.... I know my template code is fine. I tried:
my $rows=[ # { # TicketNo => 1, # Customer => "Foo", # UserName => "Foo", # DateSubmission =>"Foo", # Via =>"Foo", # Medium =>"Foo", # Issues =>"Foo", # SupportType =>"Foo", # Description =>"Foo", # Detail =>"Foo", ## AssignTo =>"Foo", # Status =>"Foo", # Remarks =>"Foo", # Priority =>"Foo", # ETD =>"Foo", # ClosedDate =>"Foo", # ClosedName =>"Foo" ## }, ## { # TicketNo => 2, # Customer => "Blah", # UserName => "Blah", # DateSubmission => "Blah", # Via => "Blah", # Medium => "Blah", # Issues => "Blah", # SupportType => "Blah", # Description => "Blah", # Detail => "Blah", # AssignTo => "Blah", # Status => "Blah", # Remarks => "Blah", # Priority => "Blah", # ETD => "Blah", # ClosedDate => "Blah", # ClosedName => "Blah" # } # # ]; #$template->param(ROWS => $rows || []);
And the rows displayed in the template. The problems seems to be with selectall_arrayref. But when I print $rows, an address is displayed-I just think $rows is empty or something. I cannot for the life of me figure out how to test selectall_arrayref. And yes I tried:
my $rows = $dbh->selectall_arrayref("SELECT TicketNo, Customer, UserNa +me, DateSubmission, Via, Medium, Issues, SupportType, Description, De +tail, AssignTo, Status, Remarks, Priority, ETD, ClosedDate, ClosedNam +e FROM TSIssuesTable WHERE Customer LIKE $quotedString1 AND Priority +LIKE $quotedString2 AND TicketNo LIKE $quotedString3 AND DateSubmissi +on LIKE $quotedString4");
Removed the COlumns=>{}-But it makes no difference. What can I do to debug further? How can I check whether selectall_arrayref returns something (besides how I am doing it now). And I must mention here that I am relatively new to perl-about 2-3 months old. About place binders
-yes, I do use them but could not use them here because I needed to use the quote function-to ensure I got the single quotes around the values used in "LIKE" -the query didn't work otherwise-and it is advisable not to use place binders with the quote function-that's what DBI documentation says.
Please help me solve this problem.

In reply to 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.