Saving data into SQL with extension

Post here your questions about Actionscript and Java server side extensions development.

Moderators: Lapo, Bax

Posts: 45
Joined: 01 Sep 2009, 13:26

Saving data into SQL with extension

Postby kaligus » 22 Nov 2009, 11:39


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){
                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?
User avatar
Site Admin
Posts: 21286
Joined: 21 Mar 2005, 09:50
Location: Italy

Postby Lapo » 23 Nov 2009, 09:43

Are there any errors on the server side after the query?
If the OK message is returned there's no good reason why data shouldn't have been saved.
...addicted to flash games
Posts: 45
Joined: 01 Sep 2009, 13:26

Postby kaligus » 23 Nov 2009, 13:33

That's the strange point :lol:

No errors in server side, the confirmation message in my serverside script works. It just does not save into MySQL.

I will check this again this week (working in another project now)... but if possible, can you make a test on your own? Then we can check if is it a bug or something.

Thanks for the reply, Lapo.

Return to “Server Side Extension Development”

Who is online

Users browsing this forum: No registered users and 3 guests