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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Limit the number of records with CFIF 1

Status
Not open for further replies.

nsukari

Technical User
Jul 17, 2002
26
0
0
US
I have a simple application set up so that users can register for certain events through our website. The registration information is added to an Access database and a confirmation e-mail is sent to the reigstrant and the person in charge of the event.

The problem is, I need to limit the number of people who attend the event. I need a code that says, "Once you get to 20 (or whatever number), send the "sorry we're full" e-mail instead of the "Your registration has been confirmed" e-mail." However, I still need the people who are overflow to be put into the DB so we can contact them for the next event.

Any help would be sincerely appreciated.
 
<cfquery name = &quot;qTotalRegistrants&quot;>
select * from table <!--- to get total amount of registrants --->
</cfquery>

<cfif #qTotalRegistrants.recordcount# gte 21>
<cfmail>
send sorry email here
</cfmail>
<cfelse>
<cfmail>
thanks for registering
</cfmail>
</cfif>
 
Thank You so much! It worked perfectly.
 
One thing to point out here...If the user doesn't get the &quot;Sorry&quot; email they will think they are registered, right? You may want to display the &quot;Sorry&quot; message on the web site instead of emailing it to them.

Just my 2 cents!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top