Help for this page

Select Code to Download


  1. or download this
    my @ar = ();
    while (my $hr = $sth->fetchrow_hashref() ) {
    ...
    }
    $s->ar = \@ar;
    $s->rows = @ar;
    
  2. or download this
    $s->ar   = $sth->fetchall_arrayref({});
    $s->rows = @{$s->ar};
    
  3. or download this
    # Assume $sth is a valid statement handle
    my $params   = $sth->fetchall_arrayref({});
    ...
    
    $template->param(TABLENAME => $params);
    print $template->output();
    
  4. 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>