Issue with scope variable?
Hi everyone,
I'm having an issue with a certain variable, that is within the scope of my CFOUTPUT.
My variable, TEMPWHO, is not being run under the CFQUERY.
If I put it outside of the output query, it will run, but nothing will show (since its a variable)
However, when I put it inside of the CFOUTPUT query (as shown below), it gives me the error: 'VARIABLE TEMPWHO is not defined', and thus, won't be able to query the data in CFQUERY.
Is there anyway to get around it? (The code that is bolded, is giving me the issue)
<cfset tempy = getems.RecordCount \ 2>
<cfset tempx = RandRange(1,tempy)>
<cfif tempx eq 0>
<cfset tempx = 1>
</cfif>
<cfoutput query="getems" startrow="#TempX#" maxrows="1">
<cfset tempwho = EmailContact>
</cfoutput>
<cfquery dbtype="query" name="GetAll">
SELECT *
FROM GetNoms, GetStuds
WHERE GetNoms.EmailContact = '#tempwho#'
AND GetNoms.IDStudent = GetStuds.IDStudent
ORDER BY EmailContact, School_Name_Previous
</cfquery>
