Jump to content

Rochet2

getMaNGOS Eluna Developer
  • Posts

    156
  • Joined

  • Last visited

  • Days Won

    18
  • Donations

    0.00 GBP 

Posts posted by Rochet2

  1. Seems you edited your post and added a question that I did not see.
    accountid is not characterid. account has multiple characters so accountid is separate from characterid. Characterid is actually character guid, which is lowguid.

    characterid = guid in database = lowguid in core functions

     

    And yes, you are right that it is characterid. But characterid is not accountid. Maybe this is the problem you have.

  2.  

    3 minutes ago, bookkc said:

    so, if i make this query

    
    local result = CharDBQuery("SELECT item_template FROM character_inventory WHERE `guid` = '"..player:GetAccountId().."';");

    all work fine...

    1

    Just because your query matches some rows in the DB doesn't mean the query is correct. Like I said earlier, guid is not accountid so your query is wrong.
    If you look at the data in your database you will likely see that the guid and accountid do not match for the rows you try to get from the database.

    You could get the player guid from the player by using a function http://www.elunaengine.com/Object/GetGUIDLow.html
    You could get the player guid through SQL joins from the character table through the accountid: https://www.w3schools.com/sql/sql_join.asp

    Maybe you should not be using SQL at all. What is it exactly that you try to do here?
    Are you trying to get an item from the player's inventory? There are many functions for it http://www.elunaengine.com/Global/RegisterPlayerEvent.html?search=getitemby

  3. The issue is not related to Eluna in any way.

    As you can see from the DB documentation: 

    the guid is not account id. guid is the character guid from characters.
    So your SQL query is wrong. Test your SQL with an SQL client to make sure it works properly.

     

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. Privacy Policy Terms of Use