Skip to main content
Inspiring
August 12, 2008
Question

Newbie question: Search query

  • August 12, 2008
  • 2 replies
  • 355 views
I'm really new to ColdFusion, so I hope this isn't a stupid question. I've been searching for the answer all over, and know it is something that most developers use, but I just can't find it. I'm able to create a search using one word, but how do I create a search with multiple words?
This topic has been closed for replies.

2 replies

Inspiring
August 12, 2008
You could try:

Select stuff
From table
WHERE field1 = "yes" or field1 = "no" or...

or maybe ues an existing list with something like this:
WHERE field1 IN (<cfqueryparam cfsqltype="cf_sql_varchar" list="yes" value="#my_list#">)
Inspiring
August 12, 2008
words = word1,word2,etc

select stuff
from tables
where

<cfloop list="#words#" index="ThisWord">
somefield like
<cfqueryparam cfsqltype="cf_sql_varchar" value="%#ThisWord#%">
or
</cfloop>
1 = 2