silverfox63
07-22-2001, 08:26 PM
Hi, I have made a coldfusion page for visitors to unsubscribe from my newsletter. Below is an error being generated that states that a query is missing from <cfoutput> tag. I have a query in this tag so do not understand the source of this. Below is the error message and below that is the CF code. Does anyone know where I am wrong?
Thanks you
silverfox
---------------------------
Error Diagnostic Information
QUERY
The QUERY attribute of the tag does not specify the name of an available query
The error occurred while processing an element with a general identifier of (CFOUTPUT), occupying document position (46:1) to (46:30).
Date/Time: 07/21/01 12:11:01
Browser: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)
Remote Address: 127.0.0.1
HTTP Referer: http://localhost/yamka/unsubscribe.cfm
------------------CF code is below
<CFIF IsDefined("email")>
<CFQUERY name="unsubscribe" datasource="yamka">
DELETE *
From emails
Where email = '#email#'
</CFQUERY>
<CFOUTPUT query="unsubscribe">
<CFIF unsubscribe.recordcount GTE "1">
Thank you, your email address [#email#] has been successfully removed from our mailing list.
<CFELSE>
We're sorry, your email address could not be found! <a href="unsubscribe.cfm">try again</a>?
</CFIF>
</CFOUTPUT>
<cfelse>
<br>
<br>
<form action="unsubscribe.cfm" method="post">
<table border="0">
<tr><td>E-mail:</td><td><input type="text" value="" name="email" size="23" maxlength="50"></td>
<tr><td> </td><td><input type="submit" value="Unsubscibe"></td></tr>
</table>
</form>
</cfif>
Thanks you
silverfox
---------------------------
Error Diagnostic Information
QUERY
The QUERY attribute of the tag does not specify the name of an available query
The error occurred while processing an element with a general identifier of (CFOUTPUT), occupying document position (46:1) to (46:30).
Date/Time: 07/21/01 12:11:01
Browser: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)
Remote Address: 127.0.0.1
HTTP Referer: http://localhost/yamka/unsubscribe.cfm
------------------CF code is below
<CFIF IsDefined("email")>
<CFQUERY name="unsubscribe" datasource="yamka">
DELETE *
From emails
Where email = '#email#'
</CFQUERY>
<CFOUTPUT query="unsubscribe">
<CFIF unsubscribe.recordcount GTE "1">
Thank you, your email address [#email#] has been successfully removed from our mailing list.
<CFELSE>
We're sorry, your email address could not be found! <a href="unsubscribe.cfm">try again</a>?
</CFIF>
</CFOUTPUT>
<cfelse>
<br>
<br>
<form action="unsubscribe.cfm" method="post">
<table border="0">
<tr><td>E-mail:</td><td><input type="text" value="" name="email" size="23" maxlength="50"></td>
<tr><td> </td><td><input type="submit" value="Unsubscibe"></td></tr>
</table>
</form>
</cfif>



