hi
i have some data that i want to output in three columns, so i'm trying to 
build a nested loop. This is the perl code:
#!/usr/bin/perl -w

use CGI;
use HTML::Template;
use strict;
use DBI;

my $q = new CGI();

my @rows = ();
my @cls = ();
my $q1 = "select id,blurb,thumb from pictures";
my $st1 = $dbh->prepare($q1);
$st1->execute;
my $cl = -1;
while (my @r = $st1->fetchrow)
        {
        $cl++;
        my %data;
        my $pic = '/pics/'.$r[2];
        $data{id} = $r[0];
        $data{pic} = $pic;
        $data{blurb} = $r[1];
        $cls[$cl] = \%data;
        if ($cl == 3)
                {
                 my %rowdata;
                 $rowdata{cols} = [EMAIL PROTECTED];
                 push (@rows,\%rowdata);
                 @cls = ();
                 $cl = -1;
                }

        }
my $log = HTML::Template->new
                        (
                        filename => 'foo.tmpl',
                        path => './tmpl',
                        associate => $q
                        );
        
$log->param(image => $title,
                        LIST => [EMAIL PROTECTED]);
print $q->header, $log->output();

_________________________________________

and this is the relevant part of the template code:

<table  border="1" cellspacing="0" cellpadding="5">

 <TMPL_LOOP NAME = "LIST">

  <tr>
  <TMPL_LOOP NAME = "cols">

   <td>
   <img src="<TMPL_VAR NAME='pic'>">
   </td>

  </TMPL_LOOP>
  </tr>

 </TMPL_LOOP>

</table>
_________________________________
but there is no output
kg


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Html-template-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/html-template-users

Reply via email to