cfqueryparam did the trick. I just wasn't sure I could nest all that
other stuff inside it.
Much appreciated to all
~|
Upgrade to Adobe ColdFusion MX7
The most significant release in over 10 years. Upgrade & see new feat
>>You can try using PreserveSingleQuotes function.
No way: PreserveSingleQuotes does not enforce single quotes escaping,
on the contrary, it disables the automatic escaping done by CF in queries.
--
___
REUSE CODE! Use custom tags;
See http://www.contentbox.c
>>INSERT INTO mytable ( myNAME )
VALUES ( '#evaluate("form.myNAME#idx#")#' )
The problem is caused by the way the automatic single quote escaping
process works (or does not work) in CF:
It only applies to variables, not to expressions.
The solution is then to evaluate your expression in a
21, 2007 12:09 PM
To: CF-Talk
Subject: Escape single quote in Multiple Row Insert Problem
Doing a multiple row insert
INSERT INTO mytable ( myNAME )
VALUES ( '#evaluate("form.myNAME#idx#")#' )
Works fine until somebody enters "Bob O'Hara" i
INSERT INTO mytable ( myNAME )
VALUES ( )
On 5/21/07, Les Mizzell <[EMAIL PROTECTED]> wrote:
> Doing a multiple row insert
>
>
> <
>
> Works fine until somebody enters "Bob O'Hara" into the form. I'm having
> a little trouble trying to escape the single quote in "O'Hara"
Use cfqueryparam,
VALUES ( )
On 5/21/07, Les Mizzell <[EMAIL PROTECTED]> wrote:
>
> Doing a multiple row insert
>
>
>
>
>
> INSERT INTO mytable ( myNAME )
> VALUES ( '#evaluate("form.myNAME#idx#")#' )
>
>
>
>
> Works fine until somebody enters "Bob O'Hara" into the form. I'm h
You can try using PreserveSingleQuotes function.
HTH
Qasim
On 5/21/07, Les Mizzell <[EMAIL PROTECTED]> wrote:
>
> Doing a multiple row insert
>
>
>
>
>
> INSERT INTO mytable ( myNAME )
> VALUES ( '#evaluate("form.myNAME#idx#")#' )
>
>
>
>
> Works fine until somebody enters "Bo
Doing a multiple row insert
INSERT INTO mytable ( myNAME )
VALUES ( '#evaluate("form.myNAME#idx#")#' )
Works fine until somebody enters "Bob O'Hara" into the form. I'm having
a little trouble trying to escape the single quote in "O'Hara" while
keeping the rest of the query
8 matches
Mail list logo