PreserveSingleQuotes()

That solves the issue and eliminates the need to do a Replace on '
marks.

Joshua Miller
Head Programmer / IT Manager
Garrison Enterprises Inc.
www.garrisonenterprises.net
[EMAIL PROTECTED]
(704) 569-9044 ext. 254
 
************************************************************************
*************
Any views expressed in this message are those of the individual sender,
except where the sender states them to be the views of 
Garrison Enterprises Inc.
 
This e-mail is intended only for the individual or entity to which it is
addressed and contains information that is private and confidential. If
you are not the intended recipient you are hereby notified that any
dissemination, distribution or copying is strictly prohibited. If you 
have received this e-mail in error please delete it immediately and
advise us by return e-mail to [EMAIL PROTECTED]
************************************************************************
*************


-----Original Message-----
From: Harley Friedman [mailto:[EMAIL PROTECTED] 
Sent: Thursday, March 13, 2003 1:58 PM
To: CF-Talk
Subject: SQL This (')


1. The only problem is the single quotes, which need to be converted to
two single quotes in a row.  The easiest way to do this is:

<cfset string=REReplace(string,"'","''","All")>

If someone is crazy enough (and aren't those end users crazy!) to put
two single quotes in a row in their text field, I'm not sure what
happens -- the RERelpace above should onvert that to 4 single quotes in
a row, which I believe would insert correctly.

2. I don't know if this will work for you, but if you name each of the
<input> fields a different name (ie. text1, text2, etc), then when the
form is submitted you can concat them using a different delimiter than a
comma.  I usually use chr(182) which is the "paragraph mark" (the
backwards "p"), since it's not usually used in text, but you could use
something more obscure, or you could even search the text first to make
sure there is no occurance of your chosen delimiter, and if so choose
another.  Then you can use all your list functions defining this as as
the delimiter.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to