Nevermind.. found the docs!

[% DBI.query('SELECT * FROM mytable where name ="joe"').get_first().0.name %]

Ken A.


Ken Anderson wrote:



For the DBI:mysql plugin, the example in the docs for TT shows something like this:


[% FOREACH thing = DBI.query('SELECT * FROM mytable') %]
 [% thing.name %]
[% END %]

This works good, but can I skip the foreach loop when I know I am just going to get one result(pri key)? I can't seem to make this work.

[% thing = DBI.query('SELECT name FROM mytable where name = "joe"') %]
[% thing.name %]
[% END %]

I've tried with SET thing = ... too, but no go..
Are there any docs available for this plugin?
Thanks for any pointers.

Ken A.


_______________________________________________ templates mailing list [EMAIL PROTECTED] http://lists.template-toolkit.org/mailman/listinfo/templates



_______________________________________________ templates mailing list [EMAIL PROTECTED] http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to