[Templates] Re: DBI question about placeholders
[prev]
[thread]
[next]
[Date index for 2004/12/13]
"Michael Peters" <mpeters@xxxxxxxxx.xxx> wrote in
message news:41BDD96E.5030606@xxxxxxxxx.xxx...
> 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
I will try it. That is one I know I did not try.
Robert
_______________________________________________
templates mailing list
templates@xxxxxxxxxxxxxxxx.xxx
http://lists.template-toolkit.org/mailman/listinfo/templates