topflight Posted March 20, 2009 Share Posted March 20, 2009 I am trying to figure out how can I get certain members out of the database who hasn't filed hours in the last 30days from the last hour filed. (i.e a member files hours on 1/20/2009 but hasn't filed hours sent them.) How can I get that member out of the database. FYI this is more of an inactivity check. But if they did file some more hours 30 days within 1/20/2009 them I want the system to wait another 30days and if no new hour was filed in 30days it will get the member is that possible? Quote Link to comment https://forums.phpfreaks.com/topic/150345-is-this-possible/ Share on other sites More sharing options...
Maq Posted March 20, 2009 Share Posted March 20, 2009 You would have to store the last time they filed. Then write a script and put it in the crontab that checks to see if the last time they filed is 30 days longer than now. Quote Link to comment https://forums.phpfreaks.com/topic/150345-is-this-possible/#findComment-789580 Share on other sites More sharing options...
topflight Posted March 20, 2009 Author Share Posted March 20, 2009 Well have a date filed in the table. So can I please see an example of how would that go? Quote Link to comment https://forums.phpfreaks.com/topic/150345-is-this-possible/#findComment-789581 Share on other sites More sharing options...
topflight Posted March 20, 2009 Author Share Posted March 20, 2009 So is their any other way of doing this? Quote Link to comment https://forums.phpfreaks.com/topic/150345-is-this-possible/#findComment-789738 Share on other sites More sharing options...
JeanieTallis Posted March 20, 2009 Share Posted March 20, 2009 last_login varchar(20), inserted in your database, so it shows there last login. As for automaticaly deleting users after 30 days, it is 100% possible. Its a SQL Query you need of course, which obviously is relating to 'delete users last log 30 days ago' Quote Link to comment https://forums.phpfreaks.com/topic/150345-is-this-possible/#findComment-789762 Share on other sites More sharing options...
JeanieTallis Posted March 20, 2009 Share Posted March 20, 2009 use the "users" table to get inactive accounts by used the field "last_login" and then to wipe out all rows linked to the master key "user_id" Which will then remove the the user after a certain amount of days given which would be using brackets (30) You will need a volunteer to write a embedded database maintenance script. There will be someone out there who can assist you. This is all I can do. Hope any of it is any use to you. Quote Link to comment https://forums.phpfreaks.com/topic/150345-is-this-possible/#findComment-789766 Share on other sites More sharing options...
Maq Posted March 20, 2009 Share Posted March 20, 2009 Insert Quote last_login varchar(20), Wrong. inserted in your database, so it shows there last login. Already discussed this. As for automaticaly deleting users after 30 days, it is 100% possible. This too... There are multiple ways to get rid of these records but I find the easiest is with the DATE_SUB() function. There are some examples you can use from the link. You also need to use the crontab or windows task scheduler depending on what OS you're server is on. I think the command is "crontab -e" or something. Read more Here. Quote Link to comment https://forums.phpfreaks.com/topic/150345-is-this-possible/#findComment-789768 Share on other sites More sharing options...
topflight Posted March 24, 2009 Author Share Posted March 24, 2009 What I am wondering is how to get the users that have not submitted any hours within 30 days after their last hour submission. Quote Link to comment https://forums.phpfreaks.com/topic/150345-is-this-possible/#findComment-793155 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.