Welcome to AC Web.
Page 2 of 2 FirstFirst 12
Results 16 to 19 of 19

Thread: Sql Problem

  1. #16
    Web Developer

    Join Date
    Oct 2010
    Location
    somewhere between <?php and ?>
    Posts
    2,772

    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Quote Originally Posted by titkata_bg View Post
    Can we stop talking about a symbol, thanks!: )
    We just did. And now you bring it up again... hahaha

  2. #17


    Join Date
    Mar 2016
    Location
    Chaos is the score upon which reality is written.
    Posts
    760
    Quote Originally Posted by titkata_bg View Post
    Can we stop talking about a symbol, thanks!: )
    I'm afraid you're too late. The subject was already over. You were eager to bring it back, don't you?

    The importance of the subject is subjective.
    In my opinion, that was important to discuss/clarify because many don't know about it.

  3. #18


    Join Date
    Apr 2011
    Location
    What's location?
    Posts
    5,898
    Quote Originally Posted by brunolopes View Post

    @creatureentry = (SELECT max(entry)+1 FROM creature_template WHERE entry= 55555),
    @name = "Ruthless",


    INSERT INTO npc_vendor (entry, item)
    SELECT @creatureentry, entry FROM item_template WHERE name = @name
    Well, first off this is how it would look templated.
    Your (SELECT max(entry)+1 FROM creature_template WHERE entry= 55555), would just return 55555 so just write it

    Code:
    SET @creatureEntry = 555555;
    SET @name = "Ruthless";
    SET @item = XXXXX; -- Set item id here
    
    DELETE FROM `npc_vendor` WHERE `Entry` =@creatureEntry;
    INSERT INTO `npc_vendor` (entry, item) VALUES (@creatureEntry, @item);
    And then we got your select query, there is no Name in that table at all.
    So let us select by entry,

    Code:
    SELECT `Entry` FROM `item_template` WHERE `Entry` = @creatureEntry;

  4. #19
    Web Developer

    Join Date
    Oct 2010
    Location
    somewhere between <?php and ?>
    Posts
    2,772

    REGISTER! (FREE)
    Registered members see less ads
    and also gain access to other great features.
    Quote Originally Posted by Mythilogic View Post
    Well, first off this is how it would look templated.
    Your (SELECT max(entry)+1 FROM creature_template WHERE entry= 55555), would just return 55555 so just write it

    Code:
    SET @creatureEntry = 555555;
    SET @name = "Ruthless";
    SET @item = XXXXX; -- Set item id here
    
    DELETE FROM `npc_vendor` WHERE `Entry` =@creatureEntry;
    INSERT INTO `npc_vendor` (entry, item) VALUES (@creatureEntry, @item);
    And then we got your select query, there is no Name in that table at all.
    So let us select by entry,

    Code:
    SELECT `Entry` FROM `item_template` WHERE `Entry` = @creatureEntry;
    Your @name variable is not even being used so not sure why you made a variable for it. Anyway it's an old thread so i guess his problem is solved by now

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •