[htmltmpl] HTML-Template and DBI
Brought to you by:
samtregar
From: Doc <n.h...@ve...> - 2002-09-22 14:09:48
|
I have attempted to make HTML-Template to work with DBI and fetching = database results using Perlmonk code: push @{$rows}, $_ while $_ =3D $sth->fetchrow_hashref(); my $template =3D HTML::Template->new(filename =3D> 'songs.tmpl'); $template->param(ROWS =3D> $rows); print $template->output(); and code here: my $template =3D HTML::Template->new( filename =3D> 'showclient.html' ) = ; my ($data,$rows,$template); while( $data =3D $sth->fetchrow_hashref() ) { push( @{$rows} , $data ); = } $template->param( { ROWS =3D> $rows } ) ; print $template->output(); It always fails on template->param function. I know about fetchall but I = also read it creates more work for Perl so I stook to this. Please help = me out.=20 |