<cfset keyword1 = "test">
<cfset keyword2 = "test">
and (prds.title like <cfqueryparam cfsqltype="cf_sql_varchar" list="true" 
value="%#keyword1#%"> OR
prds.title like <cfqueryparam cfsqltype="cf_sql_varchar" list="true" 
value="%#keyword2#%">)

or maybe

and prds.title IN <cfqueryparam cfsqltype="cf_sql_varchar" list="true" 
value="%#keyword#%">

don't forget the "%" so the keyword can be anywhere in the title

----- Original Message ----
From: ch g <[EMAIL PROTECTED]>
To: CF-Talk <[email protected]>
Sent: Wednesday, August 1, 2007 9:14:53 AM
Subject: Cfqueryparam and list

what's wrong with this code....

<cfset keyword = "test,test1">

<cfquery name='getdata' datasource='abcde'>
   SELECT * from prds
   WHERE 1 = 1
      and prds.title like <cfqueryparam cfsqltype="cf_sql_varchar" list="true" 
value="#keyword#">
</cfquery>

I am trying to get data from database with those two key words, if any title 
has the keyword test or test1 pull that data, i don't know what i am missing...

Thanks
Raj 



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Download the latest ColdFusion 8 utilities including Report Builder,
plug-ins for Eclipse and Dreamweaver updates.
http;//www.adobe.com/cfusion/entitlement/index.cfm?e=labs%5adobecf8%5Fbeta

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:285058
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to