Problem with MySQL queries menu

User Tag List

Results 1 to 6 of 6
  1. #1
    warsheep's Avatar Contributor
    Reputation
    184
    Join Date
    Sep 2006
    Posts
    1,216
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Problem with MySQL queries

    I'm using several queries, with different SET info and slightly different WHERE criterias. The problem is that for some reason, they do not work correctly.
    Code:
    -- ROGUE
    UPDATE playercreateinfo 
    SET mapID=0, zoneid=0, introid=0, positionx=1, positiony=1, positionz=1
    WHERE race=1 OR race=3 OR race=4 OR race=7 OR race=11 AND classid=4;
    
    
    -- PRIEST
    UPDATE playercreateinfo 
    SET mapID=0, zoneid=0, introid=0, positionx=2, positiony=2, positionz=2
    WHERE race=1 OR race=3 OR race=4 OR race=7 OR race=11 AND classid=5;
    The idea is that the alliance priests and rogues will get different spawn locations. However, running those two in sqlyog will set BOTH priest and rogues to spawn at 2, 2, 2 - or with other words, the location which only the priest should spawn at.


    Why is this so, and how can I fix it?

    EDIT:
    SOLVED

    For those who might be interested in a solution, this is how it's done:
    WHERE race in(1,3,4,7,11) AND classid=5;

    Note that you might have to have the numbers inside ' '
    ('1','3', and so on
    Last edited by warsheep; 12-13-2009 at 05:26 PM.
    FOR A MOMENT, NOTHING HAPPENED. THEN, AFTER A SECOND OR SO, NOTHING CONTINUED TO HAPPEN.

    Problem with MySQL queries
  2. #2
    Reflection's Avatar Legendary
    Reputation
    783
    Join Date
    Mar 2008
    Posts
    3,377
    Thanks G/R
    1/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Don't you need a ; after each query?

    Freelance Digital Artist
    https://reflectionartwork.deviantart.com
    You did not desert me
    My brothers in arms


  3. #3
    warsheep's Avatar Contributor
    Reputation
    184
    Join Date
    Sep 2006
    Posts
    1,216
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is, at the 3rd line.
    (...)AND classid=5;
    FOR A MOMENT, NOTHING HAPPENED. THEN, AFTER A SECOND OR SO, NOTHING CONTINUED TO HAPPEN.

  4. #4
    Reflection's Avatar Legendary
    Reputation
    783
    Join Date
    Mar 2008
    Posts
    3,377
    Thanks G/R
    1/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Oh wait, nevermind. My bad. Wait for stoneharry's response, imo.

    Freelance Digital Artist
    https://reflectionartwork.deviantart.com
    You did not desert me
    My brothers in arms


  5. #5
    stoneharry's Avatar Moderator Harry


    Reputation
    1618
    Join Date
    Sep 2007
    Posts
    4,564
    Thanks G/R
    151/150
    Trade Feedback
    0 (0%)
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Not sure but I know this will work since I did it:
    Code:
    
    
    Code:
    UPDATE `playercreateinfo` SET `mapID`='0' WHERE (`race`='1' OR `race`='3' OR `race`='4' OR `race`='7' OR `race`='11' AND `classid`='4');
    UPDATE `playercreateinfo` SET `zoneid`='0' WHERE (`race`='1' OR `race`='3' OR `race`='4' OR `race`='7' OR `race`='11' AND `classid`='4');
    UPDATE `playercreateinfo` SET `positionx`='1' WHERE (`race`='1' OR `race`='3' OR `race`='4' OR `race`='7' OR `race`='11' AND `classid`='4');

    etc. Honestly I suck at SQL.

  6. #6
    warsheep's Avatar Contributor
    Reputation
    184
    Join Date
    Sep 2006
    Posts
    1,216
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My current way of doing it has ~120 lines of sql.

    So sorry to say I'm not too tempted to try it that way >_>

    edit:

    Seems like I've found a way
    WHERE races in ('1', 'num2', 'num3', 'etc') AND classid=1

    Testing it out now.
    FOR A MOMENT, NOTHING HAPPENED. THEN, AFTER A SECOND OR SO, NOTHING CONTINUED TO HAPPEN.

Similar Threads

  1. Problem with MySQL server configuration
    By zimonken in forum WoW EMU Questions & Requests
    Replies: 7
    Last Post: 04-18-2009, 11:15 AM
  2. Problem with MySql
    By Noah313 in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 03-30-2009, 07:13 PM
  3. help me, plz look problem with MySQL
    By kidshan in forum WoW EMU Questions & Requests
    Replies: 4
    Last Post: 03-12-2009, 06:54 PM
  4. Problems with MySQL
    By lilreaper in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 03-22-2008, 09:18 PM
  5. Problem With MySQL Connection
    By omarer in forum World of Warcraft Emulator Servers
    Replies: 3
    Last Post: 12-07-2007, 01:02 AM
All times are GMT -5. The time now is 12:09 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search