Thread tmpl_loop switch (10 answers)
Opened by nurri at 2005-06-06 17:17

renee
 2005-06-07 14:06
#5055 #5055
User since
2003-08-04
14371 Artikel
ModeratorIn
[Homepage] [default_avatar]
Dann würde ich das jetzt so machen:
Code: (dl )
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
my $sql = "SELECT * FROM db50";
my $sth = $dbh->prepare ( $sql ) || die "Kann Satement nicht vorbereiten: $DBI::errstr\n";
$sth->execute() or die $dbh->errstr();

my $template = HTML::Template->new(filename => 'test2.html');

my @ergebnisse

while(my @result = $sth->fetchrow_array()){
$result[2] = '<a href=="link.pl">'.$result[2].'</a>' if($result[2] == 4);
my %hash = (
ID => $result[0],
NAME => $result[1],
CAT => $result[2],);
push(@ergebnisse,\%hash);
}

$template->param(ABFRAGE => \@ergebnisse);
OTRS-Erweiterungen (http://feature-addons.de/)
Frankfurt Perlmongers (http://frankfurt.pm/)
--

Unterlagen OTRS-Workshop 2012: http://otrs.perl-services.de/workshop.html
Perl-Entwicklung: http://perl-services.de/

View full thread tmpl_loop switch