please, I'm trying to save some data into MySQL and it just does not save... the code is all right... the information goes ok into cmd server (via trace command) and go ok to my game client, but it does not save into my MySQL table.
Look the code:
Code: Select all
dp.xt = queryRes.get(0).getItem("xptotal")
dp.pts = queryRes.get(0).getItem("pontos")
dp.din = queryRes.get(0).getItem("money")
dp.niv = queryRes.get(0).getItem("nivel")
dRet.xn = parseInt(dp.xt) + parseInt(dRet.XP) //xp novo
dRet.dn = parseInt(dp.din) + parseInt(dRet.din) //dindin novo
trace ("Total de " + dRet.xn + " XP e " + dRet.dn + " Moedas")
sql = "UPDATE psng_dados SET "
sql += " xptotal = '" + dRet.xn + "' AND "
sql += " money = '" + dRet.dn + "' WHERE "
sql += " nick = '" + nick + "' "
var atualizar = db.executeCommand(sql)
if (atualizar){
//ok
trace ("OK")
} else {
dRet._cmd = "nook"
}
You can see that I convert the values to INT, in trace command, the sum returns ok (right value), but it just dont save into MySQL (like nothing happens).
Can you help with this?