Rochet2
-
Posts
156 -
Joined
-
Last visited
-
Days Won
18 -
Donations
0.00 GBP
Content Type
Profiles
Bug Tracker
Wiki
Release Notes
Forums
Downloads
Blogs
Events
Posts posted by Rochet2
-
-
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...
1Just 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.aspMaybe 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 -
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. -
14 minutes ago, dves said:
What is this: for _, v in pairs(buffs) do
It loops through the elements in buffs table.
_ is the key and v is the value from the table._ is often used to indicate that the variable is not used.
https://repl.it/HLJ3/0
http://www.lua.org/manual/5.2/manual.html#3.3.5
http://www.lua.org/manual/5.2/manual.html#pdf-ipairs
http://www.lua.org/manual/5.2/manual.html#pdf-pairs- 2
SQL check error
in Support
Posted
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.