you need

SELECT * FROM table WHERE type = ? AND headline LIKE ?

or it will treat it as a literal '?'. Then your bind value should have the '%'s in it.

-Stephen

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Viljo Marrandi
Sent: Monday, July 30, 2001 10:12 AM
To: templates
Subject: Re: [Templates] syntax problem?


> [% FOREACH result = DBI.query('SELECT DATE_FORMAT(now(), \'%M %d\') as now')
> %]
> Time is [% result.now %]
> [% END %]


Got it working, thanks. But now i have another question. Let's say i 
want to make this query:

SELECT * FROM table WHERE type = ? AND headline LIKE '%?%'

Then hows this correctly accomplished? I can use two '?'s just fine but 
Plugin::DBI doesn't seem to find this last '?' between '%'s. Now what?

Rgds,
Viljo



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



Reply via email to