radalin Posted June 8, 2006 Share Posted June 8, 2006 I'm curious if there is a way to autodelete rows after a period of time of inactivity or only after a period of time. Maybe there is a way with scheduled tasks or another way, which checks rows for a time and delete rows that are created one day ago?Triggers or procedures can solve this? In mysql or pgsql or another database is such thing exists?Thank you for your time. Quote Link to comment https://forums.phpfreaks.com/topic/11472-auto-delete-options/ Share on other sites More sharing options...
fenway Posted June 9, 2006 Share Posted June 9, 2006 The "old school" way is to use a CRON job; but MySQL 5.1 supposedly has an event scheduler which will allow you to do just this without an external program (though I've never actually used it). In principle, you could add a trigger to run, but that's too much extra work for every single statement. Quote Link to comment https://forums.phpfreaks.com/topic/11472-auto-delete-options/#findComment-43547 Share on other sites More sharing options...
9911782 Posted June 9, 2006 Share Posted June 9, 2006 [!--quoteo(post=381758:date=Jun 8 2006, 11:08 PM:name=fenway)--][div class=\'quotetop\']QUOTE(fenway @ Jun 8 2006, 11:08 PM) [snapback]381758[/snapback][/div][div class=\'quotemain\'][!--quotec--]The "old school" way is to use a CRON job; but MySQL 5.1 supposedly has an event scheduler which will allow you to do just this without an external program (though I've never actually used it). In principle, you could add a trigger to run, but that's too much extra work for every single statement.[/quote]Hi I have the same problem with my website.How does this CRON job work and where do I get it. Quote Link to comment https://forums.phpfreaks.com/topic/11472-auto-delete-options/#findComment-43554 Share on other sites More sharing options...
radalin Posted June 9, 2006 Author Share Posted June 9, 2006 Yeah a simple example could be great with cron as i did not understand too much from the examples I found. Also can I work with cron in windows.And also what if i implement in my code such an execution. At every time my page will be called that function will be executed. But I think it's better if I implement it as a scheduled task. Quote Link to comment https://forums.phpfreaks.com/topic/11472-auto-delete-options/#findComment-43559 Share on other sites More sharing options...
fenway Posted June 9, 2006 Share Posted June 9, 2006 AFAIK, Windows has a different task scheduler -- something with AT command, I think. And I agree -- scheduling is definitely the way to go. Quote Link to comment https://forums.phpfreaks.com/topic/11472-auto-delete-options/#findComment-43727 Share on other sites More sharing options...
radalin Posted June 9, 2006 Author Share Posted June 9, 2006 Do you know if there is such an option like a scheduled task in postgresql Quote Link to comment https://forums.phpfreaks.com/topic/11472-auto-delete-options/#findComment-43856 Share on other sites More sharing options...
fenway Posted June 10, 2006 Share Posted June 10, 2006 [!--quoteo(post=382072:date=Jun 9 2006, 05:44 PM:name=radalin)--][div class=\'quotetop\']QUOTE(radalin @ Jun 9 2006, 05:44 PM) [snapback]382072[/snapback][/div][div class=\'quotemain\'][!--quotec--]Do you know if there is such an option like a scheduled task in postgresql[/quote]I have no idea... never used it. Quote Link to comment https://forums.phpfreaks.com/topic/11472-auto-delete-options/#findComment-43958 Share on other sites More sharing options...
Barand Posted June 10, 2006 Share Posted June 10, 2006 There is a "wincron" package avilable - try Google Quote Link to comment https://forums.phpfreaks.com/topic/11472-auto-delete-options/#findComment-43969 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.