I think you may not have the quotes correct, both of the following work for
me.....
[% FOREACH result = DBI.query("SELECT DATE_FORMAT(now(), '%M %d') as now")
%]
Time is [% result.now %]
[% END %]
or
[% FOREACH result = DBI.query('SELECT DATE_FORMAT(now(), \'%M %d\') as now')
%]
Time is [% result.now %]
[% END %]
Regards
Simon
-----Original Message-----
From: Viljo Marrandi [mailto:[EMAIL PROTECTED]]
Sent: 27 July 2001 11:46
To: [EMAIL PROTECTED]
Subject: [Templates] syntax problem?
Hello,
I have this query:
SELECT DATE_FORMAT(time, '%M %d') AS time FROM table, which works fine
in mysql prompt.
If i try to use it from [% FOREACH result = DBI.query('SELECT...') then
i get this error to erro_log:
line 5: unexpected token (%M)
How do i use it then? I tried to escape this %M but no luck :(
Thanks in advance,
Viljo
_______________________________________________
templates mailing list
[EMAIL PROTECTED]
http://www.template-toolkit.org/mailman/listinfo/templates