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

No Sleep

 This is the second day I've woken up early. Like way earlier than normal. Like four am early. I don't know what to do about it. I n...