INSERT INTO table (field1) VALUES ('#form.field1#') ;

When you do this, CF should automatically escape all single quotes. The
preserveSingleQuotes() function is generally only needed when passing full
SQL statements as variables or inserting lists (generally already quoted).
If you find for some reason this is not the case, you can use the replace()
function to escape them manually.

-----Original Message-----
From: Nick Slay [mailto:[EMAIL PROTECTED]]
Sent: January 21, 2001 20:38
To: CF-Talk
Subject: Re: SQL syntax problem


Hi, you can use a function called PreserveSingleQuotes before storing the
information to the database.

At least that's what I think it's for!!!  :^)



> From: "Phoeun Pha" <[EMAIL PROTECTED]>
> Reply-To: [EMAIL PROTECTED]
> Date: Tue, 21 Nov 2000 19:31:42 -0600
> To: CF-Talk <[EMAIL PROTECTED]>
> Subject: SQL syntax problem
>
> ok, i have a field where people type in the names of songs.  The problem
is,
> if the song title has an apostrophe in it, like "I'm comin' ova", i get an
> error.  i think it's cuz SQL don't read dem apostrophes as text.  how do i
> make the database accept them?!!
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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