Jump to content

Recommended Posts

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?

Link to comment
https://forums.phpfreaks.com/topic/150345-is-this-possible/
Share on other sites

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'

Link to comment
https://forums.phpfreaks.com/topic/150345-is-this-possible/#findComment-789762
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/150345-is-this-possible/#findComment-789766
Share on other sites

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.

Link to comment
https://forums.phpfreaks.com/topic/150345-is-this-possible/#findComment-789768
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.