Jump to content
  • 0

Delete some items of certains accounts using SQL


Question

Posted (edited)

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

7 answers to this question

Recommended Posts

  • 0
Posted
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');
  • 0
Posted

 

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

  • 0
Posted
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');
  • 0
Posted (edited)

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
  • 0
Posted

 

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';
  • 0
Posted
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!

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...