seekperlwisdom has asked for the wisdom of the Perl Monks concerning the following question:
my templatetoolkit.pl access this tt.file. i want templatetoolkit.pl to pass value of a variable which would change table name in this tt.file. i can do it with perl block but there must be a way which i cant find.i tried[% USE DBI %] [% DBI.connect('dbi:mysql:phones', 'user', 'password')%] This is what we have [% FOREACH fone = DBI.query('SELECT * FROM nokia') %] name : [% fone.modelno %]<br/> desc : [% fone.desc %]<br/> <img src="[% fone.image %]" width="60" height="60" alt="[% fone.mo +delno %]" /><br/> price: [% fone.price %]<br/> [% END %] <hr/>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Template Toolkit and DBI Changing Table Name by Variable
by merlyn (Sage) on Nov 28, 2009 at 18:02 UTC | |
by seekperlwisdom (Acolyte) on Nov 28, 2009 at 18:34 UTC | |
|
Re: Template Toolkit and DBI Changing Table Name by Variable
by ikegami (Patriarch) on Nov 28, 2009 at 18:01 UTC | |
by seekperlwisdom (Acolyte) on Nov 28, 2009 at 18:30 UTC | |
by ikegami (Patriarch) on Nov 29, 2009 at 00:20 UTC |