Re: [Templates] DBI question about placeholders
[prev]
[thread]
[next]
[Date index for 2004/12/13]
Robert wrote:
> Can I pass in a variable as the placeholder? I read in the DBI plugin docs
> that you can do something like this:
>
> [% query = DBI.prepare('SELECT * FROM users WHERE uid = ?') %]
>
> [% FOREACH user = query.execute('sam') %]
> ...
> [% END %]
>
> What I would like to do is pass a variable to the query.execute statement.
> If that is possible.
[% FOREACH user = query.execute($sam) %]
would work, assuming you have a variable visible to your template named
$sam.
--
Michael Peters
Developer
Plus Three, LP
_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates
 |
 |
Re: [Templates] DBI question about placeholders
Michael Peters 18:03 on 13 Dec 2004
|