TFS 0.2.5
This script isn't working
Debug print:
what is wrong in it?
This script isn't working
Lua:
function onLogin(cid)
if getPlayerLevel(cid) < 10 then
dofile("./config.lua")
env = assert(luasql.mysql())
con = assert(env:connect(mysqlDatabase, mysqlUser, mysqlPass, mysqlHost, mysqlPort))
id = getPlayerGUID(cid)
assert(con:execute("UPDATE `players` (`player_id` ,`level` ,`experience`) VALUES ('" .. id .. "', '10', '9300');"))
con:close()
env:close()
end
return TRUE
end
Debug print:
PHP:
[21/09/2009 12:15:21] Lua Script Error: [CreatureScript Interface]
[21/09/2009 12:15:21] data/creaturescripts/scripts/level10.lua:onLogin
[21/09/2009 12:15:21] data/creaturescripts/scripts/level10.lua:9: LuaSQL: Error executing query. MySQL: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '(`player_id` ,`level` ,`experience`) VALUES ('695', '10', '9300')' at line 1
[21/09/2009 12:15:21] stack traceback:
[21/09/2009 12:15:21] [C]: in function 'assert'
[21/09/2009 12:15:21] data/creaturescripts/scripts/level10.lua:9: in function <data/creaturescripts/scripts/level10.lua:1>
what is wrong in it?
Last edited: