• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

sql command

TriamerA

The Mystic One.
Joined
Nov 16, 2008
Messages
1,256
Reaction score
17
Location
Poland
I need to delete accounts of players which didnt log in since 20 days.

Because I found only one which was deleting players- not accounts.
It's like select from accounts lastlogin < UNIX_TIMESTAMP() - 20*24*60*60;
But it doesnt want to show me anything
 
I need to delete accounts of players which didnt log in since 20 days.

Because I found only one which was deleting players- not accounts.
It's like select from accounts lastlogin < UNIX_TIMESTAMP() - 20*24*60*60;
But it doesnt want to show me anything

you could always just delete the players first then do
Code:
  DELETE FROM accounts WHERE id NOT IN (SELECT account_id FROM players);

^ not sure all the column names are right (and remember to back up database b4 making any edits)

and if you want to delete the account and not players for whatever reason

Code:
 DELETE FROM accounts WHERE `lastday` < UNIX_TIMESTAMP() - 20*24*60*60;
 
ok thanks and i will give you rep if you will help me with this:
-deleting from non existing players depot storage ( got 150k records in "player depot".
-Player Items- 240k records
-Player storage - 210k records

And there must be records from not existing players !! Help again my hero ;D
 
ok thanks and i will give you rep if you will help me with this:
-deleting from non existing players depot storage ( got 150k records in "player depot".
-Player Items- 240k records
-Player storage - 210k records

And there must be records from not existing players !! Help again my hero ;D

thats easy
PHP:
  DELETE FROM player_skills WHERE player_id NOT IN (SELECT id FROM players);
  DELETE FROM player_storage WHERE player_id NOT IN (SELECT id FROM players);
  DELETE FROM player_depotitems WHERE player_id NOT IN (SELECT id FROM players);

you can pretty much do that for any of the player tables (items,vip,deaths etc)
 
Back
Top