I am attempting to use DBI in a template to return a message if there are no
records returned. The query works OK if there are records, but if there are
no returned records it doesn't display the message "There are no records".
Any ideas on how to make this work? I have tried both loop.count and
loop.size:
[% reports = DBI.prepare('SELECT tblInvAll.Address, tblInvAll.Utilization
FROM tblInvAll;') %]
[% FOREACH report = reports.execute() %]
[% IF loop.count == 0 %]
<TR>
<TD colspan=2>There are no
records</TD>
</TR>
[% ELSE %]
<TR>
<TD width=150>
[% report.Address %]
</TD>
<TD width=40>
[% report.Utilization %]
</TD>
</TR>
[% END %]
[% END %]
_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://lists.template-toolkit.org/mailman/listinfo/templates