Assuming the fieldnames in your template are the same as the fieldnames in your database, you can do:
$sth->execute( $SearchCrit ); my @results = (); while ( my $row = $sth->fetchrow_hashref ) { push @results, \%{ $row }; } $tmpl->param( stuff => \@results ); ...
This isn't the most efficient but it's the easiest to understand. (And for small datasets like putting tables of data in a web page, you probably won't notice the difference.)
Note that if you try a shortcut and push $row directly into @results you'll get the same row over and over.
Chris
M-x auto-bs-mode
In reply to Re: Outputing data from mySQL query into format for use with HTML::Template
by lachoy
in thread Outputing data from mySQL query into format for use with HTML::Template
by jarvis
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |