Quantcast
Channel: Adobe Community: Message List - ColdFusion
Viewing all articles
Browse latest Browse all 21760

Re: CFQUERYPARAM

$
0
0

The problem is likely with the value of trim(form.txtMyID). Directly using FORM variables is not a good idea, for a variety of reasons. It is better to initialize all your variables as uniquely named local page variables, and then assign values from FORM or other inputs after validating them.

 

<cfset ThistxtMyID = "0">

<cfif IsDefined("FORM.txtMyID") AND IsValid("integer", Trim(FORM.txtMyID)>

    <cfset ThistxtMyID = Trim(FORM.txtMyID)>

</cfif>

 

Be sure to validate ThistxtMyID before you try to use it:

 

<cfif ThistxtMyID EQ "0">

handle this error condition, don't query the database

</cfif>


Viewing all articles
Browse latest Browse all 21760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>