elpaisa Posted February 12, 2008 Share Posted February 12, 2008 Hi all! I need to handle a date field called join_date, that is in a mysql table and calculate 1 month afther the user registration, and when the month ends set automatically a field called "activated" to "0". This is the first part of various modifications that I have to do, to this user system, so I would appreciate all your help to this cause! Thanks all!, ??? Quote Link to comment Share on other sites More sharing options...
revraz Posted February 12, 2008 Share Posted February 12, 2008 How is the date stored? If you want this to happen automatically, as in without having the user log in and then set it, you'll have to use a CRON job. Quote Link to comment Share on other sites More sharing options...
elpaisa Posted February 12, 2008 Author Share Posted February 12, 2008 Yes, i'm thinking in a cron job, but it is so huge the code, i need something small, if you have some small cronjob php code to recomend I would thank you! Quote Link to comment Share on other sites More sharing options...
revraz Posted February 12, 2008 Share Posted February 12, 2008 I would just do it when they actually log in. Check the status of Activated, if it = 0 and is > 30 days, set to 1, if not then don't. If they never come back, why set it to Activated after 30 days. Quote Link to comment Share on other sites More sharing options...
elpaisa Posted February 12, 2008 Author Share Posted February 12, 2008 this is a good point to start, but how a i should calculate that 30 days for the date field Quote Link to comment Share on other sites More sharing options...
revraz Posted February 12, 2008 Share Posted February 12, 2008 Depends how you store the date. Quote Link to comment Share on other sites More sharing options...
elpaisa Posted February 12, 2008 Author Share Posted February 12, 2008 I use TIMENOW function Quote Link to comment 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.