I've got a form that allows updating multiple records using the code below.
Works great except for one thing....if the client types anything using a
single quote or apostrophe ( ' ) into the "Comments" field, I get a Syntax
Error....
So, I need a way to escape that without messing up the evaluate statements.
Suggestions? Thanks
Les
<CFOUTPUT>
<CFLOOP index="thisID" list="#FORM.ProjID#">
<CFQUERY NAME="update" datasource="creati610.data">
UPDATE INT_PROJECT
FORM_NUM= '#evaluate("FORM_NUM_#thisID#")#',
DUE_DATE= '#evaluate("FORM.DUE_DATE_#thisID#")#',
COMMENTS= '#evaluate("FORM.COMMENTS_#thisID#")#'
WHERE ID = #thisID#
</CFQUERY>
</CFLOOP>
</CFOUTPUT>
This doesn't work either...
First, set a variable:
<cfset COMV='#evaluate("FORM.COMMENTS_#thisID#")#'>
.and then inside the query:
COMMENTS = '#PreserveSingleQuotes(COMV)#'
Still errors out if I enter something like "I can't get the thing to work".
Take away the ' and it's fine....
______________________________________________________________________
Your ad could be here. Monies from ads go to support these lists and provide more
resources for the community. http://www.fusionauthority.com/ads.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists