Time:
Scotland: Fri, 9:23 pm
Rhode Island: Fri, 4:23 pm
Florida: Fri, 4:23 pm
New Mexico: Fri, 2:23 pm
California: Fri, 1:23 pm

Click here to visit Livelife365.com

Click here to visit nmdarts.com



Buy this Ad Space.

180px wide.

Please get in touch with KH@ if you are interested and make an offer.

CLICK HERE TO GET AUCTION BAR NOW
US$10 per year - Save $100s!
The Fabulously Unfair
WebX Auction Bar. For Ebay etc.
Ro-Sham-Bo the opposition. Laugh like Eric Cartman when you win! CLICK HERE NOW!


More information and sign-up.

WebXpertz Hosting.
Custom fit from $5pm. PHP/MySQL
You'll save money, we'll save money. Seems fair to me. Interested? If so Please PM me here and tell me what you need. Thanks!


Please click here for more information

For continued disscussion on this topic : coldfusion unsubscribe errors


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>&nbsp;</td><td><input type="submit" value="Unsubscibe"></td></tr>
</table>
</form>
</cfif>

jonsteele
07-22-2001, 08:58 PM
Hi silverfox,

I think the error is being caused because the DELETE sql statement doesn't return a recordset. The <cfoutptut query="x"> tag is used to output a series of rows from a recordset. So simply try this (with no query attribute). Also note you don't need quotes around the 1:


<CFIF unsubscribe.recordcount GTE 1>
Thank you, your email address <CFOUTPUT>[#form.email#]</CFOUTPUT> 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>


Give it a go and see what happens.

Jon