• 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!

Setting database value

Summ

(\/)(;,,;)(\/) Y not?
Staff member
Global Moderator
Joined
Oct 15, 2008
Messages
4,152
Solutions
12
Reaction score
1,107
Location
Germany :O
Hello
I added a new column to the "accounts" database, named "secondpass".

Why it doesn't work to set it this way?
Code:
function setSecondPass(cid,pass)
	db.executeQuery("UPDATE `accounts` SET `secondpass` = "..pass.." WHERE `id` = "..getPlayerGUID(cid)..";")
    return 1
end

It says:
Lua Script Error: [TalkAction Interface]
data/talkactions/scripts/ip.lua:eek:nSay

data/lib/function.lua:484: attempt to concatenate a nil value stack traceback:
data/lib/function.lua:484: in function 'setSecondPass'
data/talkactions/scripts/ip.lua:12: in function <data/talkactions/scripts/pass.lua:1>

484 is the line with db.execute...
 
Code:
function setSecondPass(cid, pass)
	db.executeQuery("UPDATE `accounts` SET `secondpass` = '"..pass.."' WHERE `id` = '"..getPlayerAccountId(cid).."';")
	return TRUE
end
 
Oh ye my bad..
Forgot that strings are with ' and not with " (as I tried) in databases.

Thank you :D
 
Back
Top