Need Help With two SQL Queries menu

User Tag List

Results 1 to 4 of 4
  1. #1
    BoP's Avatar Active Member
    Reputation
    43
    Join Date
    Nov 2006
    Posts
    119
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Need Help With two SQL Queries

    They're for increasing the stats on items the damage, health armor, and levels of mobs.
    So far I have this...
    Code:
    SELECT (items.stat_value1 + (items.stat_value1 * 1)),
    	     (items.stat_value2 + (items.stat_value2 * 1)),
                 (items.stat_value3 + (items.stat_value3 * 1)),
                 (items.stat_value4 + (items.stat_value4 * 1)),
                 (items.stat_value5 + (items.stat_value5 * 1)),
                 (items.stat_value6 + (items.stat_value6 * 1)),
                 (items.stat_value7 + (items.stat_value7 * 1)),
                 (items.stat_value8 + (items.stat_value8 * 1)),
                 (items.stat_value9 + (items.stat_value9 * 1)),
                 (items.stat_value10 + (items.stat_value10 * 1)),
    	     (items.dmg_min1 + (items.dmg_min1 * 1)),
                 (items.dmg_min2 + (items.dmg_min2 * 1)),
                 (items.dmg_min3 + (items.dmg_min3 * 1)),
                 (items.dmg_min4 + (items.dmg_min4 * 1)),
    	     (items.dmg_min5 + (items.dmg_min5 * 1)),
                 (items.dmg_max1 + (items.dmg_max1 * 1)),
                 (items.dmg_max2 + (items.dmg_max2 * 1)),
                 (items.dmg_max3 + (items.dmg_max3 * 1)),
                 (items.dmg_max4 + (items.dmg_max4 * 1)),
    	     (items.dmg_max5 + (items.dmg_max5 * 1)),
                 (items.armor + (items.armor * 1))
    FROM items 
    WHERE entry = ('ItemID')
    Code:
    SELECT (creature_proto.minhealth + (creature_proto.minhealth * 1)),
                 (creature_proto.maxhealth + (creature_proto.maxhealth * 1)),
    	     (creature_proto.minlevel + 10),
                 (creature_proto.maxlevel + 10),
                 (creature_proto.mindamage + (creature_proto.mindamage * 0.9)),
                 (creature_proto.maxdamage + (creature_proto.maxdamage * 0.9)),
                 (creature_proto.armor + (creature_proto.armor * 0.5))
    FROM creature_proto
    WHERE entry =  ('NPCID')
    But It doesn't CHANGE anything, ofcourse. Not sure how I could form a query that could update the item(s) with the new value??

    New Fixed Versions @ Code Paster! thanks to NRK :P
    Last edited by BoP; 06-12-2008 at 09:26 PM.

    Need Help With two SQL Queries
  2. #2
    mad93's Avatar Member
    Reputation
    3
    Join Date
    Jun 2008
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    SELECT returns a value, it doesn't modify the database. You should use UPDATE. Here an example of use -> SQL UPDATE

  3. #3
    NRK's Avatar Member
    Reputation
    19
    Join Date
    Mar 2007
    Posts
    82
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    UPDATE items SET
    	stat_value1 = stat_value1*2,
    	stat_value2 = stat_value2*2,
    	stat_value3 = stat_value3*2,
    	stat_value4 = stat_value4*2,
    	stat_value5 = stat_value5*2,
    	stat_value6 = stat_value6*2,
    	stat_value7 = stat_value7*2,
    	stat_value8 = stat_value8*2,
    	stat_value9 = stat_value9*2,
    	stat_value10= stat_value10*2,
    	dmg_min1 = dmg_min1*2,
    	dmg_min2 = dmg_min2*2,
    	dmg_min3 = dmg_min3*2,
    	dmg_min4 = dmg_min4*2,
    	dmg_min5 = dmg_min5*2,
    	dmg_max1 = dmg_max1*2,
    	dmg_max2 = dmg_max2*2,
    	dmg_max3 = dmg_max3*2,
    	dmg_max4 = dmg_max4*2,
    	dmg_max5 = dmg_max5*2,
    	armor = armor*2
    WHERE entry = ('ItemID')
    Code:
    UPDATE creature_proto SET
    	minhealth = minhealth *2,
    	maxhealth = maxhealth *2,
    	minlevel  = minlevel  +10,
    	maxlevel  = maxlevel  +10,
    	mindamage = mindamage *1.9,
    	maxdamage = maxdamage *1.9,
    	armor = armor*1.5
    WHERE entry =  ('NPCID')

  4. #4
    BoP's Avatar Active Member
    Reputation
    43
    Join Date
    Nov 2006
    Posts
    119
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hmm, i'll try this >_> thank you, both for the information and the solution +Rep btw
    Last edited by BoP; 06-12-2008 at 09:24 PM.

Similar Threads

  1. [SQL] Need help with npc_trainer sql query
    By bergis1337 in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 03-08-2011, 05:33 PM
  2. Need help with one Query
    By Boiko7530bg in forum WoW EMU Questions & Requests
    Replies: 1
    Last Post: 07-16-2009, 10:41 AM
  3. Need help with a query
    By TheZaronz in forum Programming
    Replies: 5
    Last Post: 06-29-2009, 06:17 PM
  4. Need Help With Navicat Query
    By imjustbackup in forum World of Warcraft Emulator Servers
    Replies: 6
    Last Post: 04-01-2009, 03:27 PM
  5. Need help with orginal sql file!
    By Ollox in forum WoW EMU Guides & Tutorials
    Replies: 3
    Last Post: 03-28-2008, 08:30 PM
All times are GMT -5. The time now is 11:51 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search