Variable being deleted inside of a cffunction within a cfcomponent
Hello, everyone.
Scratching my head over this one.
I'm working on a project that will print a certificate after the user has clicked a link to view a training module. Unfortunately, this isn't on a server that anyone can access, and I can't copy/paste code because my development system is on a different network that doesn't have internet access.
So, I'll do my best to get as much information as I can into this question.
When the "Print Cert" button is clicked, the page is redirected to the print_c.cfm page that also has a URL parameter (ie "print_c.cfm?tid=xx" where xx is an integer.) Within this page is a cfinvoke that calls a function that will INSERT a new record into a table indicating that the user has completed the training, and then will SELECT said record to provide information for the printed certificate.
<cffunction name="setInfo" returntype="query" output="true">
<cfargument name="user" type="string" require="yes">
<cfargument name="tid" type="string" require="yes">
<!--- as of this point, the variable "user" exists and is used --->
<cfoutput>#user#<br /></cfoutput> <!--- NO ERROR --->
<cfquery> [ insert statement ]</cfquery>
<!--- as of this point, the variable "user" no longer exists --->
<cfoutput>#user#<br /></cfoutput> <!--- ERROR THROWN HERE --->
<cfquery> [ select statement ]</cfquery>
<cfreturn this_data>
</cffunction>
Somehow, after the first query is run the variable "user" disappears. Any suggestions on what might be causing this greatly appreciated.
^_^
