Hi Mike,

>can anyone else confirm this?

Yes we have seen it as well.

>Below is the code to replicate. Is there a problem with my code or is
>this a bug in ColdFusion?
>
>---start------------------------------------
><cfset testArray = ArrayNew(1)>
><cfset testArray[1] = "te'st">
><cfquery datasource="testDB">
>         INSERT INTO temp_dammit
>         (str) VALUES('#PreserveSingleQuotes(testArray[1])#')
></cfquery>
>--- end-------------------------------------

We found that you have to grab the array item you want and put it in a 
simple variable then present that to the query:

<cfset tempvar = testArray[1]>
<cfquery datasource="testDB">
   INSERT INTO temp_dammit
   (str) VALUES('#PreserveSingleQuotes(tempvar)#')
</cfquery>

It seems that PreserveSingleQuotes() can only handle a simple text string 
directly. Maybe its a pointers thing?

--

Yours,

Kym


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to