Time:
Scotland: Sat, 6:37 am
Rhode Island: Sat, 1:37 am
Florida: Sat, 1:37 am
New Mexico: Fri, 11:37 pm
California: Fri, 10:37 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.

Selanac Embroidery and Screen Printing

Embroidery
Screen Printing
Signs and Banners
Promotional Advertising

WEBSITE

Contact Paul Canales
TEl: USA 732-901-8417
CELL: USA 732-773-1339


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