How do I perform an uptate statement ?

JonRM posted 9 years ago in General
Can somone tell me how I peform an uptate statement
and, when we are on it, how to remove one ?


Sorry if I posted wrong.
Dr. Dave posted 9 years ago
UPDATE tablename SET myInt='123' WHERE FieldName='myName'
Dr. Dave posted 9 years ago
When you say "how", do you mean what is the syntax for a MySQL UPDATE statment? Or do you mean, "how" do I actually query the statement from whatever application I'm using?
JonRM posted 9 years ago
Well.. They QUERY ..
I should have wrote REMOVE instead of add :oops:

Lets say I want to add:

INSERT INTO items (entry, class, subclass, field4, name1, name2, name3, name4, displayid, quality, flags, buyprice, sellprice, inventorytype, allowableclass, allowablerace, itemlevel, requiredlevel, RequiredSkill, RequiredSkillRank, RequiredSkillSubRank, RequiredPlayerRank1, RequiredPlayerRank2, RequiredFaction, RequiredFactionStanding, `Unique`, maxcount, ContainerSlots, stat_type1, stat_value1, stat_type2, stat_value2, stat_type3, stat_value3, stat_type4, stat_value4, stat_type5, stat_value5, stat_type6, stat_value6, stat_type7, stat_value7, stat_type8, stat_value8, stat_type9, stat_value9, stat_type10, stat_value10, dmg_min1, dmg_max1, dmg_type1, dmg_min2, dmg_max2, dmg_type2, dmg_min3, dmg_max3, dmg_type3, dmg_min4, dmg_max4, dmg_type4, dmg_min5, dmg_max5, dmg_type5, armor, holy_res, fire_res, nature_res, frost_res, shadow_res, arcane_res, delay, ammo_type, `range`, spellid_1, spelltrigger_1, spellcharges_1, spellcooldown_1, spellcategory_1, spellcategorycooldown_1, spellid_2, spelltrigger_2, spellcharges_2, spellcooldown_2, spellcategory_2, spellcategorycooldown_2, spellid_3, spelltrigger_3, spellcharges_3, spellcooldown_3, spellcategory_3, spellcategorycooldown_3, spellid_4, spelltrigger_4, spellcharges_4, spellcooldown_4, spellcategory_4, spellcategorycooldown_4, spellid_5, spelltrigger_5, spellcharges_5, spellcooldown_5, spellcategory_5, spellcategorycooldown_5, bonding, description, page_id, page_language, page_material, quest_id, lock_id, lock_material, sheathID, randomprop, unk203_1, block, itemset, MaxDurability, ZoneNameID, mapid, bagfamily, TotemCategory, socket_color_1, unk201_3, socket_color_2, unk201_5, socket_color_3, unk201_7, socket_bonus, GemProperties, ReqDisenchantSkill, unk2) 
VALUES (18,2,7,-1,"Thunderfury, The Second","Thunderfury, The Second","Thunderfury, The Second","Thunderfury, The Second",30606,5,0,0000,0000,13,-1,-1,80,70,0,0,0,0,0,0,0,2,1,0, 3,456, 32,89, 13,235, 4,164, 6,369, 0,0, 0,0, 0,0, 0,0, 0,0,340,458,0,23,45,3,0,0,0,0,0,0,0,0,0,0,34,34,70,65,2,23,344,0,0,38611,0,1,23455,1141,23455,42083,2,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,"Wielded by the Night Elf: Alanna",0,0,0,0,0,1,3,0,0,0,0,125,0,0,0,0,1,0,1,0,1,0,2874,0,0,0);

Then I use QUERY.. But how do I remove stuffs like this ? :?
Dr. Dave posted 9 years ago
DELETE FROM items WHERE entry='18' AND class='2' AND subclass='7' and field4='-1' AND name1='Thunderfury, The Second'
Dr. Dave posted 9 years ago
Or, if the "entry" field is a Unique ID, you could simply:
DELETE FROM items WHERE entry='18'

and still be safe.

Please login to leave a reply, or register at first.