Jump to content
  • 0

Delete some items of certains accounts using SQL


Kakaroto

Question


  • Group:  Members
  • Topic Count:  99
  • Topics Per Day:  0.02
  • Content Count:  623
  • Reputation:   94
  • Joined:  05/11/12
  • Last Seen:  

Hello, does anyone know how do I delete a specific item in the storage of an account using SQL command, for example: the account 20000000 has 5 items equal to the account, and I want to delete this item using his ID to completely delete the item storage and character inventory, but using the item ID.

 

Sorry for my bad English.
I thank anyone who can help me.

Edited by Kakaroto
Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  520
  • Reputation:   64
  • Joined:  11/19/11
  • Last Seen:  

DELETE FROM `storage` WHERE `nameid` = '4407' and account_id = '2000000';

If you want to delete in more than 1 account or more than 1 item.

DELETE FROM `storage` WHERE `nameid` in ('4407','4408') and account_id in ('2000000','2000001');
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  745
  • Reputation:   47
  • Joined:  03/12/14
  • Last Seen:  

1st off your Server

 

This Code Delete all Randgris Card Just change the id #

DELETE FROM `storage` WHERE `nameid`=4407;
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  99
  • Topics Per Day:  0.02
  • Content Count:  623
  • Reputation:   94
  • Joined:  05/11/12
  • Last Seen:  

 

1st off your Server

 

This Code Delete all Randgris Card Just change the id #

DELETE FROM `storage` WHERE `nameid`=4407;

 

 

but I need to delete only a specific account ...

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  36
  • Topics Per Day:  0.01
  • Content Count:  383
  • Reputation:   121
  • Joined:  03/31/12
  • Last Seen:  

DELETE FROM `storage` WHERE `nameid` = '4407' and account_id = '2000000';

If you want to delete in more than 1 account or more than 1 item.

DELETE FROM `storage` WHERE `nameid` in ('4407','4408') and account_id in ('2000000','2000001');

If multiple this?

DELETE FROM `storage` WHERE `nameid` in ('4407','4408','4407') and account_id in ('2000000','2000001','20000002');
Link to comment
Share on other sites

  • 0

  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2348
  • Joined:  10/28/11
  • Last Seen:  

DELETE FROM `inventory` WHERE `char_id` = 12345 AND `nameid` = 4407

DELETE FROM `inventory` WHERE `char_id` = 12345 AND `card0` = 4407

DELETE FROM `inventory` WHERE `char_id` = 12345 AND `card1` = 4407

DELETE FROM `inventory` WHERE `char_id` = 12345 AND `card2` = 4407

DELETE FROM `inventory` WHERE `char_id` = 12345 AND `card3` = 4407

you need to do this for other table like
  • cart_inventory
  • auction
  • mail
  • storage
  • etc
Edited by Emistry
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  15
  • Topics Per Day:  0.00
  • Content Count:  520
  • Reputation:   64
  • Joined:  11/19/11
  • Last Seen:  

 

DELETE FROM `storage` WHERE `nameid` = '4407' and account_id = '2000000';

If you want to delete in more than 1 account or more than 1 item.

DELETE FROM `storage` WHERE `nameid` in ('4407','4408') and account_id in ('2000000','2000001');

If multiple this?

DELETE FROM `storage` WHERE `nameid` in ('4407','4408','4407') and account_id in ('2000000','2000001','20000002');

 

Yes you can also use BETWEEN if you have a series/continuous of account id's. (BETWEEN keyword speak itself)

DELETE FROM `storage` WHERE `nameid` in ('4407','4408','4407') and account_id BETWEEN '2000000' and '2000005';
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  99
  • Topics Per Day:  0.02
  • Content Count:  623
  • Reputation:   94
  • Joined:  05/11/12
  • Last Seen:  

DELETE FROM `storage` WHERE `nameid` = '4407' and account_id = '2000000';

If you want to delete in more than 1 account or more than 1 item.

DELETE FROM `storage` WHERE `nameid` in ('4407','4408') and account_id in ('2000000','2000001');

 

 

 

DELETE FROM `storage` WHERE `nameid` = '4407' and account_id = '2000000';

If you want to delete in more than 1 account or more than 1 item.

DELETE FROM `storage` WHERE `nameid` in ('4407','4408') and account_id in ('2000000','2000001');

If multiple this?

DELETE FROM `storage` WHERE `nameid` in ('4407','4408','4407') and account_id in ('2000000','2000001','20000002');

 

 

DELETE FROM `inventory` WHERE `char_id` = 12345 AND `nameid` = 4407
DELETE FROM `inventory` WHERE `char_id` = 12345 AND `card0` = 4407
DELETE FROM `inventory` WHERE `char_id` = 12345 AND `card1` = 4407
DELETE FROM `inventory` WHERE `char_id` = 12345 AND `card2` = 4407
DELETE FROM `inventory` WHERE `char_id` = 12345 AND `card3` = 4407
you need to do this for other table like
  • cart_inventory
  • auction
  • mail
  • storage
  • etc

 

 

 

thank you guys!

Link to comment
Share on other sites

Join the conversation

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

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  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...