Jump to content
  • 0

SQL Commands


Crystal

Question

5 answers to this question

Recommended Posts

  • 0

DELETE FROM traders_data WHERE columnname = 'itemname'


For example, you want to delete Skin_FR_OHara_DZ from the item column:
DELETE FROM traders_data WHERE item = '["Skin_FR_OHara_DZ",1]'

Or you want to delete every entry with traderid '476':
DELETE FROM traders_data WHERE tid = '476'

Or maybe you want to delete every entry with traderid '476' + only the ones which cost 1 itemgoldbar:

DELETE FROM traders_data WHERE tid = '476' AND sell = '[1,"ItemGoldBar",1]'

If you are using a program like HeidiSQL/Navicat you can also just right click on the row(s) you want to delete, and click delete row(s). :P

Link to comment
Share on other sites

  • 0
UPDATE traders_data SET buy = 'new price' WHERE columnname = 'item that needs price to be changed'

So something like this:

UPDATE traders_data SET buy = '[1,"ItemGoldBar",1]' WHERE item = '["Skin_FR_OHara_DZ",1]'

The WHERE function is important because if you leave it out, it will replace every price from every item in the traders_data table. So it basically is there to define exactly where you want a price to be changed. So if you want to do this through a sql query, make sure to have a unique name like an item name in the WHERE function. You can even make it more precice by adding an AND columnname = 'somethingelse' to it. Just like the DELETE example i showed in my other post.

 

You don't have HeidiSQL or Navicat or something? Because if you're gonna change prices from items it might be easier to do so with one of those programs. Don't really see a sql schedule to be used for systematically changing prices :P

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...