Question
SQL Query Error Help !!
Here is the Query:
<cfquery name="get_facilities" dbtype="query">
SELECT
shopid, name, address, city, zip, phone, keyword
FROM get_shops
WHERE(
<cfloop index="i" list="#form.keywords#" delimiters=" ">
UPPER(keywords_#request.language#) LIKE UPPER('%#i#%') AND
</cfloop>
UPPER(keywords_#request.language#) LIKE '%%')
ORDER BYzip
</cfquery>
Here is the error:
"The Pattern of the LIKE conditional is malformed"
Here is what was entered in the keyword field in the form, the person was searching for "star auto[obile".
automobile was misspelled with a [.
How do I fix this? Can I fix it in the query?
<cfquery name="get_facilities" dbtype="query">
SELECT
shopid, name, address, city, zip, phone, keyword
FROM get_shops
WHERE(
<cfloop index="i" list="#form.keywords#" delimiters=" ">
UPPER(keywords_#request.language#) LIKE UPPER('%#i#%') AND
</cfloop>
UPPER(keywords_#request.language#) LIKE '%%')
ORDER BYzip
</cfquery>
Here is the error:
"The Pattern of the LIKE conditional is malformed"
Here is what was entered in the keyword field in the form, the person was searching for "star auto[obile".
automobile was misspelled with a [.
How do I fix this? Can I fix it in the query?
