Jump to content
  • 0

How to WIPE a specify item on database?


Tales

Question


  • Group:  Members
  • Topic Count:  163
  • Topics Per Day:  0.04
  • Content Count:  319
  • Reputation:   8
  • Joined:  02/05/12
  • Last Seen:  

How?

Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  14
  • Topics Per Day:  0.00
  • Content Count:  317
  • Reputation:   63
  • Joined:  11/13/11
  • Last Seen:  

You can, though you'd have to write 4x more queries for it, it's still do-able. Here's an example for cart_inventory;

UPDATE `cart_inventory` SET `card0` = '0' WHERE `cart_inventory`.`card0` = 'XXXX';
UPDATE `cart_inventory` SET `card1` = '0' WHERE `cart_inventory`.`card1` = 'XXXX';
UPDATE `cart_inventory` SET `card2` = '0' WHERE `cart_inventory`.`card2` = 'XXXX';
UPDATE `cart_inventory` SET `card3` = '0' WHERE `cart_inventory`.`card3` = 'XXXX';

Replace XXXX with the Item ID of the MVP Card you wanted to delete. Setting it to 0 is better than deleting it, for me at least.

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  22
  • Topics Per Day:  0.00
  • Content Count:  1479
  • Reputation:   172
  • Joined:  12/14/11
  • Last Seen:  

DELETE FROM `table_name` WHERE condition1 = "string" OR condition2 = number AND condition3 = "whatever";

ex:

DELETE FROM `global_reg_value` WHERE `str` = "#CASHPOINTS" AND account_id = 20000;

to embed with a NPC script, it will be:

query_sql("DELETE FROM `global_reg_value` WHERE `str` = "#CASHPOINTS" AND account_id = "+escape_sql(getcharid(3))+"");

SQL::DELETE. Refer: http://www.w3schools.com/sql/sql_delete.asp

how did I found this out? https://www.google.com/

Edited by Winz
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  163
  • Topics Per Day:  0.04
  • Content Count:  319
  • Reputation:   8
  • Joined:  02/05/12
  • Last Seen:  

Maybe this can help me, but if i want to delete a MvP card that are equipped this can be a problem?

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