Crystal Posted February 3, 2014 Report Share Posted February 3, 2014 Hi all I know that when i want to add things to traders, the command is: INSERT INTO `traders_data` (`item`,`qty`,`buy`,`sell`,`order`,`tid`,`afile`) VALUES but what about items I want to remove from the traders? Link to comment Share on other sites More sharing options...
0 wokkelwakker Posted February 3, 2014 Report Share Posted February 3, 2014 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 Crystal 1 Link to comment Share on other sites More sharing options...
0 Crystal Posted February 3, 2014 Author Report Share Posted February 3, 2014 Brilliant thank you! Does entering rows / deleting rows manually not cause issues? Link to comment Share on other sites More sharing options...
0 fr1nk Posted February 3, 2014 Report Share Posted February 3, 2014 Nope, manual insert/delete is fine...just tedious :lol: Link to comment Share on other sites More sharing options...
0 Crystal Posted February 4, 2014 Author Report Share Posted February 4, 2014 One more thing - what would be the command to replace? say... replace a price - change 1 gold bar to 3 gold bar etc? Link to comment Share on other sites More sharing options...
0 wokkelwakker Posted February 5, 2014 Report Share Posted February 5, 2014 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 More sharing options...
Question
Crystal
Hi all
I know that when i want to add things to traders, the command is:
INSERT INTO `traders_data` (`item`,`qty`,`buy`,`sell`,`order`,`tid`,`afile`) VALUES
but what about items I want to remove from the traders?
Link to comment
Share on other sites
5 answers to this question
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now