To insert an apostrophes you have to double it up hence
INSERT INTO tblUserComments (userid, usercomment)
VALUES (12345, 'I don''t know what to think')
Will work as you want it to...... use the replace function..
> -----Original Message-----
> From: andrew kopelman [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 27, 2001 12:39 AM
> To: CF-Talk
> Subject: Escaping apostrophes
>
>
> Hello,
>
> This must be a basic question, but I found no real answer on
> the allaire
> forums.
>
> I want to allow users to enter apostrophes in text, which I
> then save to the
> database. However, the sql insert will fail as it interprets this
> apostrophe within the text as one of the apostrophes
> surrounding the text.
>
> Example:
>
> INSERT INTO tblUserComments (userid, usercomment)
> VALUES (12345, 'I don't know what to think')
>
> This fails on the ' in don't
>
> There must be a better solution than HTMLEditFormat.
>
> Thanks in advance.
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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