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
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
cfqueryparam did the trick. I just wasn't sure I could nest all that
other stuff inside it.
cfqueryparam cfsqltype=cf_sql_varchar
value=#form[myNAME idx]#
Much appreciated to all
~|
Upgrade to Adobe
Doing a multiple row insert
cfloop from=1 to=#int(request.numTRAVEL)# index=idx
cfquery name=WRITE_ENROLL
INSERT INTO mytable ( myNAME )
VALUES ( '#evaluate(form.myNAME#idx#)#' )
/cfquery
/cfloop
Works fine until somebody enters Bob O'Hara into the form. I'm having
a little
You can try using PreserveSingleQuotes function.
HTH
Qasim
On 5/21/07, Les Mizzell [EMAIL PROTECTED] wrote:
Doing a multiple row insert
cfloop from=1 to=#int(request.numTRAVEL)# index=idx
cfquery name=WRITE_ENROLL
INSERT INTO mytable ( myNAME )
VALUES (
Use cfqueryparam,
VALUES ( cfqueryparam cfsqltype=cf_sql_varchar value=#evaluate(
form.myNAME#idx#)#)
On 5/21/07, Les Mizzell [EMAIL PROTECTED] wrote:
Doing a multiple row insert
cfloop from=1 to=#int(request.numTRAVEL)# index=idx
cfquery name=WRITE_ENROLL
INSERT INTO mytable
cfloop from=1 to=#int(request.numTRAVEL)# index=idx
cfquery name=WRITE_ENROLL
INSERT INTO mytable ( myNAME )
VALUES ( cfqueryparam cfsqltype=cf_sql_varchar
value=#form[myNAME idx]# )
/cfquery
/cfloop
On 5/21/07, Les Mizzell [EMAIL PROTECTED] wrote:
Doing a multiple row
To: CF-Talk
Subject: Escape single quote in Multiple Row Insert Problem
Doing a multiple row insert
cfloop from=1 to=#int(request.numTRAVEL)# index=idx
cfquery name=WRITE_ENROLL
INSERT INTO mytable ( myNAME )
VALUES ( '#evaluate(form.myNAME#idx#)#' )
/cfquery
/cfloop
Works
8 matches
Mail list logo