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

We Live In A Simulation

 You read that title right. We live in a simulation. Nothing is real. It's as real as you want it to be. But that doesn't mean it...