in reply to Re: using template on same page
in thread using template on same page
tho i get this error when i try to get array from db. but the code works ok just only not getting array's
#MY SCRIPT use strict; use warnings; use Template; my $template = Template->new; if($info) { my $select = $DBH->prepare("SELECT FOO, BAR, MOO FROM tble WHERE CONCA +T(FOO, ', ', BAR, ', ', MOO) LIKE ?"); $select->execute('%'.$info.'%'); $names = $select->fetchall_arrayref(); foreach $names ( @$names) { ($variable1, $variable2, $variable3) = @$names; } } my $templ = <<START_HTML; <!DOCTYPE html"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1 +" /> <title>Untitled Document</title> </head> <body> [% FOREACH name IN list %] <li> <div class='inforno'> <img src='inforno'> </div> <div class='inforno'> <a href='#' class='inforno'>[% name %]</a> </div> <span class='inforno'> <a href='#' class='inforno'>Edit user</a> </span> </li> [% END %] </body> </html> START_HTML $template->process (\$templ, { list => \@names }) or die $template->error;
MY OUTPUT
ARRAY(0x2030674) ARRAY(0x2030634) ARRAY(0x2030618)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: using template on same page
by davido (Cardinal) on Sep 15, 2018 at 17:45 UTC | |
|
Re^3: using template on same page
by Corion (Patriarch) on Sep 15, 2018 at 17:14 UTC | |
|
Re^3: using template on same page
by poj (Abbot) on Sep 15, 2018 at 17:27 UTC | |
by bigup401 (Pilgrim) on Sep 16, 2018 at 09:46 UTC | |
by poj (Abbot) on Sep 16, 2018 at 11:29 UTC | |
|
Re^3: using template on same page
by bliako (Abbot) on Sep 16, 2018 at 10:11 UTC | |
by bigup401 (Pilgrim) on Sep 16, 2018 at 11:27 UTC | |
by poj (Abbot) on Sep 16, 2018 at 17:15 UTC | |
by bigup401 (Pilgrim) on Sep 16, 2018 at 19:06 UTC | |
by poj (Abbot) on Sep 16, 2018 at 19:24 UTC | |
|