Sunday, January 15, 2012

Using like in a cfqueryparam

So there I was... attempting to figure out the best way to to a like clause in a query statement using the cfqueryparam tag.



I had it coded like this:




like <cfparam cfsqltype="cf_sql_varchar" value="#arguments.search_criteria#">


Well that didn't work. So I did some googling. After a little bit of searching, I finally found out how it should be coded.




like <cfparam cfsqltype="cf_sql_varchar" value="%#arguments.search_criteria#%">


After laughing at how simple that was... I used it. Worked like a charm.

No comments:

Post a Comment

Ever feel like no one is listening?

 Ever have that feeling that no one is listening to you? Yeah, that feeling. It can be a strong feeling to have, a hurtful feeling also. The...