When people sign up they choose their service from a list,
state from a list and enter keywords from a textbox which is
into the table. They can enter it any way they want.
When people go to search, they have to choose a state and a
The keywords is optional and is a textbox. They may just put
random words in there or separate them with comma or such.
I need a SQL code written that will take the state and the
service which are
always chosen and add the option of keywords.
I would like this put into a CFC to use on the site.
How much would anyone / everyone charge me to do this for me?
I am at my
wits end and don't have the time to keep this request up.
I will probably learn better from seeing it completed then to
send me to places.
If you need any other information, please ask.
Listed below is that I have currently. Everything works fine
except for the
keywords section. It works if one word is entered, but bombs
if you enter
more than one.
<cffunction name="ServiceSearch" access="remote"
<cfargument name="service" type="string"
<cfargument name="state" type="string"
<cfargument name="keywords" type="string"
Select company, name, phone, service, city, state, username
WHERE service = #arguments.service# AND state =
<cfif len(trim(arguments.keywords)) GT 0>
AND keywords LIKE '%#Trim(arguments.keywords)#%'
ORDER BY company ASC
you would have to tell the users to separate the entered
keywords by comma or space. Then you would take that list and
delimit it into a array. This can then be feed to your query like
<cfset searchlogic2 = ListAppend(searchlogic2,'AND Title
like "#First Item of Array#%"',' ')>
You would have to loop over your array to append all of the
keywords to the searchlogic2 string.
Then you just use that sting in your
<cfquery name="GetActivity" datasource="WEARS">