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


Template:
<TMPL_LOOP NAME="RESULTS">
  <TMPL_VAR NAME="age"><TMPL_VAR NAME="day">
</TMPL_LOOP>


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.


-Thanks




#####  CGI::Application community mailing list  ################
##                                                            ##
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp    ##
##                                                            ##
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:          http://cgiapp.erlbaum.net/                 ##
##                                                            ##
################################################################

Reply via email to