There is also a CF Function to deal just with single quotes in data, oddly
enough called PreserveSingleQuote.  Double quotes inside single-quoted text
shouldn't be a problem.  

The following code bombs...
<CFSET var="Brian's Book">
<CFQUERY...>
insert into table values ('#var#)
</CFQUERY>

This code works:
<CFSET var="Brian's Book">
<CFQUERY...>
insert into table values ('#PreserveSingleQuotes(var)#')
</CFQUERY>

The SQL output is:
insert into table values ('Brian''s Book')

Brian

-----Original Message-----
From: Ryan [mailto:[EMAIL PROTECTED]]
Sent: Monday, January 15, 2001 10:34 AM
To: CF-Talk
Subject: RE: quot problem


I've never had a problem with single or double quotes, am I missing
something? I always use CFQUERYPARAM when inserting data, so the
data can contain all the single and double quotes it wants. Is
there a problem selecting and displaying the data?

If you are talking about displaying the data in a form field, then
I have experienced that problem: <INPUT VALUE="Mr. "T" Foley"> causes
problems. I don't allow double quotes at all in my text fields.

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

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to