Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

2 single quotes

Status
Not open for further replies.

BigBadDave

Programmer
May 31, 2001
1,069
EU
Why does CF add in a second single quote to the following:

Code:
<cfscript>
  sql = &quot;SELECT * FROM students WHERE sid Is Not Null AND sname <> 'Byng' AND sname <> 'Burns' AND incs <> 'true'&quot;;
  if (IsDefined (&quot;o&quot;)) {
      sql = sql & &quot; AND paid = '#o#'&quot;;
  }
  sql = sql & &quot; ORDER BY sname, fname ASC&quot;;
  total = 10;
</cfscript>
<cfquery name=&quot;ema&quot; datasource=&quot;ema&quot;>
  #sql#
</cfquery>

It %*&%* up the SQL and dosn't work:

SQL SELECT * FROM students WHERE sid Is Not Null AND sname <> ''Byng'' AND sname <> ''Burns'' AND incs <> ''true'' AND paid = ''Y'' ORDER BY sname, fname ASC
DATASOURCE ema
VENDORERRORCODE 1064
SQLSTATE 42000 Regards
David Byng
bd_logo.gif

davidbyng@hotmail.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top