- or download this
my @ar = ();
while (my $hr = $sth->fetchrow_hashref() ) {
...
}
$s->ar = \@ar;
$s->rows = @ar;
- or download this
$s->ar = $sth->fetchall_arrayref({});
$s->rows = @{$s->ar};
- or download this
# Assume $sth is a valid statement handle
my $params = $sth->fetchall_arrayref({});
...
$template->param(TABLENAME => $params);
print $template->output();
- or download this
<TABLE>
<TMPL_LOOP NAME=TABLENAME>
<TR><TD><TMPL_VAR NAME=COLUMN1></TD><TD><TMPL_VAR NAME=COLUMN2></TD>
+</TR>
</TMPL_LOOP>
</TABLE>