•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the ColdFusion section within the Web Development category of DaniWeb, a massive community of 426,568 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 1,635 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: 1892 | Replies: 1
![]() |
•
•
Join Date: Mar 2006
Posts: 1
Reputation:
Rep Power: 0
Solved Threads: 0
Hey, I'm new here, so I have a question. I did a form in coldfusion that creates tables of data of students when they submit their info, but when a dates comes the superadmin can purge the old dates of the data and this deletes the entries with this date.
So this is what we did:
<cfif Session.type neq 'super'>
You are not authorized for this page
<cfabort>
<cfelse>
<cfif NOT IsDefined("form.date")>
<h1>You did not specify the Date</h1>
Please try again <a href="purge_database.cfm">here</a>
<cfabort>
</cfif>
<cfquery datasource="aasdfaa">
DELETE FROM DATABASE
WHERE year < '#Right(form.date,2)#'
</cfquery>
<cfquery datasource="aasdfaa">
DELETE FROM DATABASE
WHERE year = '#Right(form.date,2)#' AND projgraddate<='#form.date#'
</cfquery>
<cflocation url="index.cfm">
</cfif>
So the question is how can I show the numbers of deleted entries?
So this is what we did:
<cfif Session.type neq 'super'>
You are not authorized for this page
<cfabort>
<cfelse>
<cfif NOT IsDefined("form.date")>
<h1>You did not specify the Date</h1>
Please try again <a href="purge_database.cfm">here</a>
<cfabort>
</cfif>
<cfquery datasource="aasdfaa">
DELETE FROM DATABASE
WHERE year < '#Right(form.date,2)#'
</cfquery>
<cfquery datasource="aasdfaa">
DELETE FROM DATABASE
WHERE year = '#Right(form.date,2)#' AND projgraddate<='#form.date#'
</cfquery>
<cflocation url="index.cfm">
</cfif>
So the question is how can I show the numbers of deleted entries?
•
•
Join Date: Mar 2006
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
1) Give your query a name:
<cfquery name="DeleteRecords" datasource="aasdfaa">
DELETE FROM DATABASE
WHERE year = '#Right(form.date,2)#' AND projgraddate<='#form.date#'
</cfquery>
2) Output the recordcount of the query:
<cfoutput>#DeleteRecords.RecordCount#</cfoutput>
<cfquery name="DeleteRecords" datasource="aasdfaa">
DELETE FROM DATABASE
WHERE year = '#Right(form.date,2)#' AND projgraddate<='#form.date#'
</cfquery>
2) Output the recordcount of the query:
<cfoutput>#DeleteRecords.RecordCount#</cfoutput>
•
•
•
•
Originally Posted by kakumeii
Hey, I'm new here, so I have a question. I did a form in coldfusion that creates tables of data of students when they submit their info, but when a dates comes the superadmin can purge the old dates of the data and this deletes the entries with this date.
So this is what we did:
<cfif Session.type neq 'super'>
You are not authorized for this page
<cfabort>
<cfelse>
<cfif NOT IsDefined("form.date")>
<h1>You did not specify the Date</h1>
Please try again <a href="purge_database.cfm">here</a>
<cfabort>
</cfif>
<cfquery datasource="aasdfaa">
DELETE FROM DATABASE
WHERE year < '#Right(form.date,2)#'
</cfquery>
<cfquery datasource="aasdfaa">
DELETE FROM DATABASE
WHERE year = '#Right(form.date,2)#' AND projgraddate<='#form.date#'
</cfquery>
<cflocation url="index.cfm">
</cfif>
So the question is how can I show the numbers of deleted entries?
![]() |
•
•
•
•
•
•
•
•
DaniWeb ColdFusion Marketplace
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
- How to recover files that were deleted from the trash bin (Windows 9x / Me)
- Any help will be greatly appreciated... (Viruses, Spyware and other Nasties)
- Using a class to add/delete/show numbers in a Link List (C++)
- How many different numbers are there? (C++)
- Begginer here needs help (C)
- TROJ STILEN.A, ADW RULEDOR.C, BKDR SANDBOX.S detected using Trend Micro House Call (Viruses, Spyware and other Nasties)
- Bridge.dll and other probs (Viruses, Spyware and other Nasties)
Other Threads in the ColdFusion Forum
- Previous Thread: Error Handling in CFSCRIPT
- Next Thread: Check new UserID - if taken or not


Linear Mode