SaMz Posted July 7, 2008 Share Posted July 7, 2008 I want to delete users offline for 30 days what is the sql query, thanks for your help Quote Link to comment Share on other sites More sharing options...
Floydian Posted July 7, 2008 Share Posted July 7, 2008 Re: How Do I Delete The Inactive delete from users where laston < unix_timestamp() - 60 * 60 * 24 * 30 Take the current time, and subtract 30 days from it. You're subtracting seconds, so you need 30 days worth of seconds: 60 seconds * 60 (minutes) * 24 (hours) * 30 (days) now that you have a timestamp that points to 30 days ago, you simply need to see if laston is less than that. "laston" may be a different column name, I'm not 100% if that's the right name for that as mccodes isn't what I work on day in day out. Keep in mind, just deleting the users presents some problems. If they had a gang, and they were the leader, and no one else is in the gang, that gang will be stuck having 0000000000 members. Any items they had for sale in the market will point to User=> [] Basically, it'll be empty. There's more things that happen, trust me. You really need to be thorough about removing all traces of the user, and not just their row in the users table. Quote Link to comment Share on other sites More sharing options...
AlabamaHit Posted July 8, 2008 Share Posted July 8, 2008 Re: How Do I Delete The Inactive Yup...you woudl have to remove from for example users, userstats, delete the gang, (if you have mods...remove them from there examle honors.) and so on and on...and if they are in fed..you have to remove them from there..... 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.