dcsimg
www.webdeveloper.com
Results 1 to 7 of 7

Thread: Automatic deletion of rows, timestamps

  1. #1
    Join Date
    Feb 2010
    Posts
    28

    Automatic deletion of rows, timestamps

    Im fairly new to SQL code to bear that in mind.

    Anyways does anyone know how to make it so when someone makes a new row in my table (aka: someone creates an account), after 24 hours if a field in that row: status is not set to: "activated", then the row gets deleted? (aka: the account gets deleted if its not activated after 24 hours)

  2. #2
    Join Date
    Jul 2007
    Posts
    58
    Hi,

    You will have to write a script, which should be executed automatically after fixed intervals of time and will pick the records where the time difference between the current time and the time at which the record was inserted is more than 24 hours, simply delete those records.

    Hope this helps.

    Cheers,

    ~Maneet

  3. #3
    Join Date
    Feb 2010
    Posts
    28
    What would I write it in? How would I write it? I wouldn't know how to make it run automatically. I think I need more detail than that........

  4. #4
    Join Date
    Oct 2009
    Posts
    658
    What database you are using and what platform. Linux environment have cron jobs which is equivalent to win sched jobs. There is also agent jobs in MSSQL you can use.

  5. #5
    Join Date
    Feb 2010
    Posts
    28
    I'm using MySQL.........
    Windows 7

  6. #6
    Join Date
    Jul 2007
    Posts
    58
    Hi,

    You can install PHP on your machine, and develop a script in PHP to do that. And since you are using Windows 7 as the opertaing system you will have to setup windows scheduled tasks to make this script to run at fixed intervals of time.

    Cheers,

    ~Maneet

  7. #7
    Join Date
    Feb 2010
    Posts
    28
    Okay thanks!
    Can you look at this topic:
    http://www.webdeveloper.com/forum/sh...d.php?t=226063

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles