EasyCFM.COM ColdFusion Forums / Tutorial Requests! / Setting DB records to expire

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Setting DB records to expire

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

amser
01-14-2004 @ 9:21 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 40
Joined: Dec 2003

Hi,

Here's what I'm trying to do!

A user can enter his name in a simple table by submitting a form:

UserID
UName
DateAdded
Active

Active is set to 1 when user adds his name.
(done all that!)

How do I allow Active to be 1 for 1 month, then "expire" automatically by setting Active to 0 and also send an email to the user to notify him that his name is no longer active?

Cheers

Confusion Expert!!!!!!!!!

CJ
01-14-2004 @ 9:57 AM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4262
Joined: Oct 2002

set up a template in the CF scheduler to run daily.

in that template:

SELECT *
FROM table
WHERE
     dateAdded > <cfqueryparam value="#dateAdd('m', -1, now())#" cfsqltype="cf_sql_date">

do a <cfmail> based on that query results to inform the users that their membership has expired.

-CJ-
@ #coldfusion/DALNet
http://charlie.griefer.com

amser
01-14-2004 @ 5:45 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 40
Joined: Dec 2003

THANKS CJ

Confusion Expert!!!!!!!!!


Website Designed and Developed by Pablo Varando.