On 8/1/07, ch g <[EMAIL PROTECTED]> wrote:
>
> SELECT * from prds
> WHERE 1=1
> AND (prds.title like '%test%'
> OR prds.title like '%test1%')
>
> How to implement that logic for more than 3 keywords(on the fly)?
>
> Thanks
> Raj
>
<cfquery>
SELECT
columns
FROM
prds
WHERE
<cfloop list="#myList#" index="idx">
prds.title LIKE <cfqueryparam value="%#idx#%"
cfsqltype="cf_sql_char" />
OR
</cfloop>
1=1
</cfquery>
--
Charlie Griefer
================================================
"...All the world shall be your enemy, Prince with a Thousand Enemies,
and whenever they catch you, they will kill you. But first they must catch
you, digger, listener, runner, prince with a swift warning.
Be cunning and full of tricks and your people shall never be destroyed."
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Check out the new features and enhancements in the
latest product release - download the "What's New PDF" now
http://download.macromedia.com/pub/labs/coldfusion/cf8_beta_whatsnew_052907.pdf
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285080
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4