anushka Posted March 26, 2008 Share Posted March 26, 2008 Hi If user is not using his account,it should get deleted automatically.how it takes place in mailiing Services like gmail,hotmail.How Can i do this in php Can any one help me out Quote Link to comment https://forums.phpfreaks.com/topic/97955-it-should-get-deleted-automatically-after-30-days/ Share on other sites More sharing options...
ansarka Posted March 26, 2008 Share Posted March 26, 2008 you have to store the last login date of each user , this you can update when each user logins then run a query to delete all the users whose last login date is 30 days before this you can do in two ways 1. running a page manually 2. running a php page in corn every day midnight Quote Link to comment https://forums.phpfreaks.com/topic/97955-it-should-get-deleted-automatically-after-30-days/#findComment-501161 Share on other sites More sharing options...
anushka Posted March 26, 2008 Author Share Posted March 26, 2008 running a page manually running a php page in corn every day midnight means what.How i should run the page By using cookies or what Quote Link to comment https://forums.phpfreaks.com/topic/97955-it-should-get-deleted-automatically-after-30-days/#findComment-501163 Share on other sites More sharing options...
laffin Posted March 26, 2008 Share Posted March 26, 2008 store the last on into his acct and do this periodically with a mysql query check $res=mysql_query("SELECT id FROM users WHERE TO_DAYS(NOW()) - TO_DAYS(last_on) >= 30"); Quote Link to comment https://forums.phpfreaks.com/topic/97955-it-should-get-deleted-automatically-after-30-days/#findComment-501164 Share on other sites More sharing options...
ansarka Posted March 26, 2008 Share Posted March 26, 2008 running a page means you have to write a php code to delete the records which are older than 30 days you can use the code posted by laffin running the php code can be , give an link to this page to admin or set this page to run by cron job Quote Link to comment https://forums.phpfreaks.com/topic/97955-it-should-get-deleted-automatically-after-30-days/#findComment-501167 Share on other sites More sharing options...
anushka Posted March 26, 2008 Author Share Posted March 26, 2008 Thanks lot Quote Link to comment https://forums.phpfreaks.com/topic/97955-it-should-get-deleted-automatically-after-30-days/#findComment-501169 Share on other sites More sharing options...
anushka Posted March 26, 2008 Author Share Posted March 26, 2008 Thanks lot Quote Link to comment https://forums.phpfreaks.com/topic/97955-it-should-get-deleted-automatically-after-30-days/#findComment-501171 Share on other sites More sharing options...
Tjorriemorrie Posted March 26, 2008 Share Posted March 26, 2008 running a page means you have to write a php code to delete the records which are older than 30 days you can use the code posted by laffin running the php code can be , give an link to this page to admin or set this page to run by cron job Thank you. Me too appreciate clear answers much more. Quote Link to comment https://forums.phpfreaks.com/topic/97955-it-should-get-deleted-automatically-after-30-days/#findComment-501172 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.