[Templates] Re: DBI question about placeholders

[prev] [thread] [next] [Date index for 2004/12/13]

From: Robert
Subject: [Templates] Re: DBI question about placeholders
Date: 18:13 on 13 Dec 2004
"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

Re: [Templates] DBI question about placeholders
Michael Peters 18:03 on 13 Dec 2004

[Templates] Re: DBI question about placeholders
Robert 18:13 on 13 Dec 2004

Re: [Templates] DBI question about placeholders
Andy Wardley 08:54 on 14 Dec 2004

Generated at 08:55 on 15 Mar 2005 by mariachi v0.52