I've got a CFLoop that performs a query to check for a valid email address from our list of email users.
Here's a rough outline of the code
<cfif domainchk is 1> <!--- checks for valid @domain.com --->
<!--- if valid domain check for valid username --->
<cfquery name="echeck" datasource="email">
select username from emaillist
where username = '#form.email#'
</cfquery>
<cfelse>
<cfset echeck.recordcount = 0> <!--- zero out the recordcount in the cases where the query wasn't run --->
</cfif>
What's happening is that the first iteration of the loop (which has a good domain name) runs ok, the second iteration (which has a bad domain name) errors out because the echeck query still exists from the previous iteration.
I know that this is a weird way of coding things, but I've done strange coding all my life and just can't seem to stop! =)
Any suggestions?
Roger
Here's a rough outline of the code
<cfif domainchk is 1> <!--- checks for valid @domain.com --->
<!--- if valid domain check for valid username --->
<cfquery name="echeck" datasource="email">
select username from emaillist
where username = '#form.email#'
</cfquery>
<cfelse>
<cfset echeck.recordcount = 0> <!--- zero out the recordcount in the cases where the query wasn't run --->
</cfif>
What's happening is that the first iteration of the loop (which has a good domain name) runs ok, the second iteration (which has a bad domain name) errors out because the echeck query still exists from the previous iteration.
I know that this is a weird way of coding things, but I've done strange coding all my life and just can't seem to stop! =)
Any suggestions?
Roger