User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ColdFusion section within the Web Development category of DaniWeb, a massive community of 401,738 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 4,231 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.
Views: 1853 | Replies: 1
Reply
Join Date: Mar 2006
Posts: 1
Reputation: kakumeii is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
kakumeii kakumeii is offline Offline
Newbie Poster

Show Numbers of Deleted entries from database

  #1  
Mar 13th, 2006
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?
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Mar 2006
Posts: 2
Reputation: paulbaylis is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
paulbaylis paulbaylis is offline Offline
Newbie Poster

Re: Show Numbers of Deleted entries from database

  #2  
Mar 25th, 2006
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>



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?
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ColdFusion Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ColdFusion Forum

All times are GMT -4. The time now is 9:33 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC