MySQL does not save [account]
#1

Hello,

I could put my GamePlay, in MySQL, but a pity that when the player disconnected trase no backup in my database (DB), here is the code so that you can help me.

Thank you in advance.


pawn Code:
if(Logged[playerid] == 1)
    {
        new score = GetPlayerScore(playerid);
        new money = GetPlayerMoney(playerid);
        new CompteBanque = BankCash[playerid];
        new AdmLevel = AdminLevel[playerid];
        new Army = CanUseArmy[playerid];
        new CIA = CanUseCIA[playerid];
        new Lgroove = CanUseLeaderGroove[playerid];
        new groove = CanUseGroove[playerid];
        new Lballas = CanUseLeaderBallas[playerid];
        new ballas = CanUseBallas[playerid];
        new Regular = ("RegularPlayer",IsRegularPlayer[playerid]);
        new Drug = DrugHouseOwner[playerid];
        new Otto = OttoOwner[playerid];
        new Skill = TerroristSkill[playerid];
        new RSkill = RobSkill[playerid];
        new C4 = HasPackC4[playerid];
        new Rope = HasPackRope[playerid];
        new Pmoney = HasPackMoney[playerid];
        new Wanted = SavedWantedLevel[playerid];
        new Jail = SavedJailTime[playerid];
        new query[718]; //Creates the variables
        GetPlayerName(playerid, pname, 24); //Gets the players name.
        format(query, sizeof(query), "UPDATE oweo_compte SET Level=%d, Bankcash=%d, Cash=%d, Adminlevel=%d, Army=%d, CIA=%d, LeaderGroove=%d, Groove=%d, LeaderBallas=%d, Ballas=%d, RegularPlayer=%d, DrugHouseOwner=%d, OttoOwner=%d, TSkill=%d, RobSkill=%d, HasPackC4=%d, HasPackRope=%d, SavedWantedLevel=%d, SavedJailTime=%d WHERE compte='%s'",
        score, CompteBanque, money, AdmLevel, Army, CIA, Lgroove, groove, Lballas, ballas, Regular, Drug, Otto, Skill, RSkill, C4, Rope, Pmoney, Wanted, Jail, pname);
        mysql_query(query);
    }
ps: I apologize for my English, I am French.

Sincerely, TomyZ
Reply
#2

Up, please !!
Reply
#3

In the query use ' ' example: "update users set level = '%d'"
Reply
#4

Sorry, I did not quite understand ..
I hope someone could help me on the problem.
Reply
#5

enable debug and post the last debug message in debug.txt
Reply
#6

pawn Code:
[19:09:36] CMySQLHandler::Query(UPDATE oweo_compte SET Level=0, Bankcash=0, Cash=0, Adminlevel=0, Army=0, CIA=0, LeaderGroove=0, Groove=0, LeaderBallas=0, Ballas=0, RegularPlayer=0, DrugHouseOwner=0, OttoOwner=0, TSkill=0, RobSkill=0, HasPackC4=0, HasPackRope=0, SavedWantedLevel=0, SavedJailTime=0 WHERE compte='') - Successfully executed.
Reply
#7

Up please, help my ..
Reply
#8

try this
Code:
format(query, sizeof(query), "UPDATE oweo_compte SET Level='%d', Bankcash='%d', Cash='%d', Adminlevel='%d', Army='%d', CIA='%d', LeaderGroove='%d', Groove='%d', LeaderBallas='%d', Ballas='%d', RegularPlayer='%d', DrugHouseOwner='%d', OttoOwner='%d', TSkill='%d', RobSkill='%d', HasPackC4='%d', HasPackRope='%d', SavedWantedLevel='%d', SavedJailTime='%d' WHERE compte='%s'",
        score, CompteBanque, money, AdmLevel, Army, CIA, Lgroove, groove, Lballas, ballas, Regular, Drug, Otto, Skill, RSkill, C4, Rope, Pmoney, Wanted, Jail, pname);
Reply
#9

If you see the debug code, you'll notice that the query criteria for 'compte' was '' (nothing), so it can't complete the update query as it doesn't know what to update.

Try format your query again, if the code in the post above mine doesn't fix your problem.
Reply
#10

Thank you for your response, I try it all on.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)