CFQUERY Not escaping single quotes properly [duplicate]
Possible Duplicate: Coldfusion adding extra quotes when constructing database queries in strings All, I am trying to use a getter to reference a bean during an insert. CF is not escaping the single quote properly in the value in 'form.title' and therefore I am receiving a malformed sql error. Any ideas? Here's the code. <cfscript> form.title = "page's are awesome"; page = new model.page.page(argumentCollection = form); <cfquery name="test" datasource="ksurvey"> insert into page(title) values('#page.getTitle()#') </cfquery> If you're going to do it that way, you need preserveSingleQuotes()