Link to home
Start Free TrialLog in
Avatar of pigmentarts
pigmentartsFlag for United Kingdom of Great Britain and Northern Ireland

asked on

cf ListAppend?

hi, hope someone can help me on this...


this pull out all my words...

<cfloop index="i" list="#subject#" delimiters=" .,?!:<>">
                         <cfif Len(i) GT 3>
                               <cfif listFindNoCase(goodlist, i) eq 0>
                                <cfset goodlist = ListAppend(goodlist, "%#i#%' OR subject LIKE '", " ") />
                                </cfif>
                         </cfif>
                  </cfloop>

goodlist is now this...
'%What%' OR subject LIKE ' %methodology%' OR subject LIKE '

i want to now take my words and search...

SELECT *
FROM articles
WHERE subject LIKE '#goodlist#'

but as you can see the sql is wrong, i get one too many OR subject LIKE and at the end 2x '

anh help to make the string vailed sql?
ASKER CERTIFIED SOLUTION
Avatar of js_vaughan
js_vaughan

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of pigmentarts

ASKER

thanks