BlogCFC Update

A user reported an issue with BlueDragon/MySQL. I was able to reproduce the issue. I used code like this:

,allowcomments = <FONT COLOR=MAROON><cfqueryparam value=<FONT COLOR=BLUE>"#arguments.allowcomments#"</FONT> cfsqltype=<FONT COLOR=BLUE>"CF_SQL_TINYINT"</FONT>></FONT>

Which worked fine under CFMX even when the value was a boolean. In BD, it seems as if the queryparam was a bit stricter, which seems to make sense. So I simply added this code (where applicable):

<FONT COLOR=MAROON><cfif arguments.allowcomments></FONT>
   <FONT COLOR=MAROON><cfset arguments.allowcomments = 1></FONT>
   <FONT COLOR=MAROON><cfset arguments.allowcomments = 0></FONT>

As a warning - watch those queryparams if building code that needs to run both on CFMX and BD. I won’t say one is wrong and one is right - but there are definitely differences. Luckily, I’ve been able to tweak things to run nicely on both platforms w/o using any “hacks.”

Raymond Camden's Picture

About Raymond Camden

Raymond is a developer advocate. He focuses on JavaScript, serverless and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA