Doing a multiple row insert
<cfloop from="1" to="#int(request.numTRAVEL)#" index="idx">
<cfquery name="WRITE_ENROLL" >
INSERT INTO mytable ( myNAME )
VALUES ( '#evaluate("form.myNAME#idx#")#' )
</cfquery>
</cfloop>
Works fine until somebody enters "Bob O'Hara" into the form. I'm having
a little trouble trying to escape the single quote in "O'Hara" while
keeping the rest of the query intact.
If if was a single record insert something like the below would work fine:
'#Replace(form[myNAME],"'","''","ALL")#'
Suggestions?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
ColdFusion MX7 by AdobeĀ®
Dyncamically transform webcontent into Adobe PDF with new ColdFusion MX7.
Free Trial. http://www.adobe.com/products/coldfusion?sdid=RVJV
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278763
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4