Use cfqueryparam,
VALUES ( <cfqueryparam cfsqltype="cf_sql_varchar" value="#evaluate("
form.myNAME#idx#")#">)
On 5/21/07, Les Mizzell <[EMAIL PROTECTED]> wrote:
>
> 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?
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Upgrade to Adobe ColdFusion MX7
Experience Flex 2 & MX7 integration & create powerful cross-platform RIAs
http://www.adobe.com/products/coldfusion/flex2/?sdid=RVJQ
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:278765
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4