www.webdeveloper.com
Recent Articles
  • Finding Slow Running Queries in ASE 15
  • A More Advanced Pie Chart for Analysis Services Data
  • Adobe AIR Programming Unleashed: Working with Windows
  • Performance Testing SQL Server 2008's Change Data Capture Functionality
  • The ABC's of PHP: Introduction to PHP
  • How to Migrate from BasicFiles to SecureFiles Storage
  • Why the Twitter Haters Are Wrong
  • User Personalization with PHP: Beginning the Application
  • Whats in an Oracle Schema?
  • Lighting Enhancement in Photoshop
  •  

    Go Back   WebDeveloper.com > Server-Side Development > SQL

    SQL For all Structured Query Language, and general database questions.

    Reply
     
    Thread Tools Rate Thread Display Modes
      #1  
    Old 03-08-2010, 09:58 PM
    Charybdis Charybdis is offline
    Registered User
     
    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)
    Reply With Quote
      #2  
    Old 03-09-2010, 06:23 AM
    maneetpuri maneetpuri is offline
    Registered User
     
    Join Date: Jul 2007
    Posts: 45
    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
    __________________
    Maneet Puri
    Web Design & Development Services
    Reply With Quote
      #3  
    Old 03-09-2010, 01:02 PM
    Charybdis Charybdis is offline
    Registered User
     
    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........
    Reply With Quote
      #4  
    Old 03-09-2010, 06:29 PM
    ssystems ssystems is offline
    Registered User
     
    Join Date: Oct 2009
    Posts: 317
    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.
    Reply With Quote
      #5  
    Old 03-09-2010, 06:33 PM
    Charybdis Charybdis is offline
    Registered User
     
    Join Date: Feb 2010
    Posts: 28
    I'm using MySQL.........
    Windows 7
    Reply With Quote
      #6  
    Old 03-10-2010, 06:25 AM
    maneetpuri maneetpuri is offline
    Registered User
     
    Join Date: Jul 2007
    Posts: 45
    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
    __________________
    Maneet Puri
    Web Design & Development Services
    Reply With Quote
      #7  
    Old 03-10-2010, 12:36 PM
    Charybdis Charybdis is offline
    Registered User
     
    Join Date: Feb 2010
    Posts: 28
    Okay thanks!
    Can you look at this topic:
    http://www.webdeveloper.com/forum/sh...d.php?t=226063
    Reply With Quote
    Reply

    Bookmarks


    Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
     
    Thread Tools
    Display Modes Rate This Thread
    Rate This Thread:

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off
    Forum Jump


    All times are GMT -5. The time now is 12:41 PM.



    Acceptable Use Policy

    Internet.com
    The Network for Technology Professionals

    Search:

    About Internet.com

    Legal Notices, Licensing, Permissions, Privacy Policy.
    Advertise | Newsletters | E-mail Offers

    Powered by vBulletin® Version 3.7.3
    Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.