Use the  '#preservesinglequotes(message)#' function to preserve the single
quotes in the text.

John Anderson


-----Original Message-----
From: Jeff Green [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 20, 2001 11:58 AM
To: CF-Talk
Subject: He said, "I would like to insert commas and quotes in the DB"


Hi all,

I have a form with a text area field where users can text, which in turn
gets inserted in the DB.  It all works good till the user enters commas and
quotes.

example:

<textarea name="message">
This is user input.  The user likes to use commas and quotes, like this.
The user said, "I just love commas and quotes".
</textarea>

Now that field trys to get inserted into the DB, which results in:

INSERT INTO Comments(UserID, Message)
    VALUES (123, "This is user input.  The user likes to use commas and
quotes, like this.  The user said, "I just love commas and quotes".")

And this obviously causes some problems.  Data gets inserted but its
chopping off the message after the first quote.

I was thinking many of you probably have had to deal with this issue, so any
help is greatly appreciated.

Thanks,
Jeff
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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