Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clearing a query....

Status
Not open for further replies.

varnix

Programmer
Joined
Jan 7, 2002
Messages
94
Location
US
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=&quot;echeck&quot; datasource=&quot;email&quot;>
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
 
Nevermind!

Found a work around! =)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top