•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ColdFusion section within the Web Development category of DaniWeb, a massive community of 427,763 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,681 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ColdFusion advertiser: Programming Forums
Views: 1739 | Replies: 1
![]() |
•
•
Join Date: Apr 2005
Posts: 6
Reputation:
Rep Power: 0
Solved Threads: 0
I made an online registration form using ColdFusion MX and Access 2003. I want to be able to make it so when there are 20 entries into the database it will stop accepting signups. Does anyone know of any code that I could put on the page that checks for the number of entries and stops people from signing up if the limit has been met? Thanks!
•
•
Join Date: Apr 2005
Location: Ontario, Canada
Posts: 24
Reputation:
Rep Power: 4
Solved Threads: 1
Ok,
This is the code,
<cfquery name="number_entries" datasource="Your DNS">
SELECT “Primary Key Column�
FROM “Your table name�
WHERE “Primary Key Column� = 20
</cfquery>
<cfif number_entries.RecordCount NEQ 0>
<! ---this is the url the user will be sent to if you record count = 20--->
<! ---you have to create the “sorry.cfm� to tell the user that no more recorders can be added--->
<cflocation url="sorry.cfm" />
<cfelse>
<!--- if the count is < 20 than you INSERT the VALUES-->
<cfquery datasource="Your DNS">
INSERT INTO ( )
VALUES ( )
</cfquery>
</cfif>
It worked for me so it should work for you.
Take care,
Walyer
Walyer's Playpen
This is the code,
<cfquery name="number_entries" datasource="Your DNS">
SELECT “Primary Key Column�
FROM “Your table name�
WHERE “Primary Key Column� = 20
</cfquery>
<cfif number_entries.RecordCount NEQ 0>
<! ---this is the url the user will be sent to if you record count = 20--->
<! ---you have to create the “sorry.cfm� to tell the user that no more recorders can be added--->
<cflocation url="sorry.cfm" />
<cfelse>
<!--- if the count is < 20 than you INSERT the VALUES-->
<cfquery datasource="Your DNS">
INSERT INTO ( )
VALUES ( )
</cfquery>
</cfif>
It worked for me so it should work for you.
Take care,
Walyer
Walyer's Playpen
![]() |
•
•
•
•
•
•
•
•
DaniWeb ColdFusion Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- Clean Previous Next Script for MySQL results (PHP)
- phpBB bots creating fake users! (Growing an Online Community)
- Deleting the database rows and adding new rows (Visual Basic 4 / 5 / 6)
- Show Numbers of Deleted entries from database (ColdFusion)
- populating a listbox from another listbox dynamically?? (ASP)
- New Table Design (Database Design)
- Access Web Database? (Database Design)
Other Threads in the ColdFusion Forum
- Previous Thread: - Recently Unemployed CF Developer
- Next Thread: Error Handling in CFSCRIPT


Linear Mode