Idesdema wrote: <cfoutput query="people_with_parens"><cfif #first_name# CONTAINS "("> |
I don't see how this would matter, ColdFusion is usually pretty forgiving of this error. But your syntax has unnecessary pound|hash marks. You don't need them in the <cfif....> statement. It would normally be written as.
<cfif first_name CONTAINS "(">
Or maybe better yet:
<cfif people_with_parans.first_name CONTAINS "(">
Still not the whole story I suspect, try pasting up your *actual* code. I just did this, which works perfectly:
<cfscript>
people_with_parens = queryNew("first_name", "VarChar") ;
queryAddRow(people_with_parens) ;
querySetCell(people_with_parens, "first_name", "Dave" ) ;
queryAddRow(people_with_parens) ;
querySetCell(people_with_parens, "first_name", "Bill (short)" ) ;
queryAddRow(people_with_parens) ;
querySetCell(people_with_parens, "first_name", "Larry (tall)" ) ;
queryAddRow(people_with_parens) ;
querySetCell(people_with_parens, "first_name", "Steve" ) ;
queryAddRow(people_with_parens) ;
querySetCell(people_with_parens, "first_name", "Mary (mean)" ) ;
</cfscript>
<cfoutput query="people_with_parens">
<cfif #first_name# CONTAINS "(">
#first_name#
</cfif>
</cfoutput>
Outputs:
Bill (short) Larry (tall) Mary (mean)