[Zope-DB] Re: zSQL method question

Martin Gebert Murphy@members.netsolution-net.de
Sat, 01 Mar 2003 21:07:39 +0100


Marc Stein schrieb:
> I apologize if this is a particularly stupid question, but...
> 
> I want to search against a text field in MySQL using a zSQL method such that
> my search query is wrapped in % wildcard characters.
> 
> select * from xyz where
> <dtml-sqltest search_query column=txCriteria op=like type=string>
> 

Untested: What about using

<dtml-sqltest txCriteria op="like" type="string">

and calling the method with

myZSQLMethod(txCriteria="%"+query_string+"%")

where I presume that query_string comes e. g. from a form.
Any problems with that? If yes, *what exactly* is the problem? You didn't mention that above...
Hint: If you describe your problem exactly, you get exact help...

Martin