Skip to main content
Inspiring
April 17, 2008
Question

Insert # into database

  • April 17, 2008
  • 3 replies
  • 309 views
Hi

I have a problem.
I have the following
<cfset newcolor = "000000">

<cfquery name="UpdateColor" datasource="#application.db#">
UPDATE tblsites
SET SBGCOL = '#newcolor#'
WHERE USERID = #session.userid#
</cfquery>

...HOWEVER, i want to insert a # before posting the color var!

Please can someone explain how to do this!

Thanks in advance
Delon

This topic has been closed for replies.

3 replies

Inspiring
April 17, 2008
Thanks.

I feel kinda stupid now!
It works 100%
Inspiring
April 17, 2008
Use two of them.
Inspiring
April 17, 2008
Flashdakota wrote:
> Please can someone explain how to do this!

You escape it so that ColdFusion knows it is not a variable delimiter.
In ColdFusion you escape control characters by doubling them.

I.E.

SET SBGCOL = '###newcolor#'.