[cgiapp] Proper Way To Load Template Params

adam at spatialsystems.org adam at spatialsystems.org
Sun Mar 15 23:33:52 EDT 2009

My template is getting data via a SQL query.  There is exactly one row
Currently I use the below method to show all records using a loop:
  RESULTS => $self->dbh->selectall_arrayref('
    SELECT age, day FROM table WHERE id = ?',
    { Slice => {} },
    $self->session->param('cell')->{'sid'} )

  <TMPL_VAR NAME="age"><TMPL_VAR NAME="day">

But how should I load the template if I have exactly one row returned? 
I could fudge it and use the loop to iterate of the one row, but I think
that may be a sub optimal method.


More information about the cgiapp mailing list