• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Lua MySQL doubt

Kirtash

New Member
Joined
Nov 23, 2008
Messages
26
Reaction score
0
I'm trying to get the account id value when I have the account name, but it returns me a ''.
Anyone sees what's happening here?

account.name[cid] = db.getResult("select id from (select * from accounts where name = ".. db.escapeString(account.name[cid]) .. ") as res1")

Thanks :)
Kirtash~
 
Either you try:
getAccountIdByAccount(accName)

or

Lua:
local res = db.getResult("SELECT id FROM accounts WHERE name = ".. db.escapeString(account.name[cid]) .. ";")
if res:getID() ~= -1 then
  local id = res:getDataInt("id")
  -- do what you want with id
else
  -- account not found
end
 
Back
Top Bottom