SA-MP Forums Archive
Mysql saving issue - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Mysql saving issue (/showthread.php?tid=609822)



Mysql saving issue - Problems - 16.06.2016

I put these codes inder OnPlayerDisconnect to save stats but these codes don't update the player's stats ,what's the problem in these codes?

Код:
mysql_format(koneksi, query, sizeof(query), "UPDATE `users` SET `Money` = %d, `Bankcash` = %d, `Score` = %d, `Adminlevel` = %d,`Nameban` = %d, `example1` = %d, `example2` = %d,`example3` = %d WHERE `Name` = %e",\
GetPlayerCash(playerid), Player[playerid][Bankcash],GetPlayerScore(playerid),Player[playerid][Adminlevel],
Player[playerid][Nameban],Player[playerid][example1],Player[playerid][example2],Player[playerid][example3], playername);
mysql_query(koneksi, query);

//

mysql_format(koneksi, query, sizeof(query), "UPDATE `users` SET `example4` = %d, `example5` = %d, `example6` = %d, `example7` = %d,`example8` = %d, `example9` = %d, `example10` = %d WHERE `Name` = %e",\
Player[playerid][example4],Player[playerid][example5],Player[playerid][example6],Player[playerid][example7],Player[playerid][example8],Player[playerid][example9],
Player[playerid][example10], playername);
mysql_query(koneksi, query);



Re: Mysql saving issue - GangstaSunny - 17.06.2016

Firstly, cut your strings please instead of sending more than one query.
And please check the mysql_log and maybe post it.


Re: Mysql saving issue - Problems - 17.06.2016

Firstly,I'm still trying to convert my script from dini into mysql so I'm new so i dunno how to "cut" my strings as you said.
Secondly,mysql_log got nothing


Re: Mysql saving issue - oMa37 - 17.06.2016

Does the data save to the mysql database? But doesn't load?
Or it's not saving/loading?


Re: Mysql saving issue - Problems - 17.06.2016

It loads what i edit in the table but doesn't save any changes in the server.


Re: Mysql saving issue - Problems - 17.06.2016

Can anyone tell me am I using the right way of saving or not?


Re: Mysql saving issue - WhiteGhost - 17.06.2016

Did u load the accounts?


Re: Mysql saving issue - Problems - 17.06.2016

Yeah the player accounts get created and when I login I can login but I can't save anything in the database only loading,Am I using the right way of saving or not?or the problem is in the table itself?


Re: Mysql saving issue - Konstantinos - 17.06.2016

String specifiers need apostrophe around them like '%s' and '%e'


Re: Mysql saving issue - Problems - 17.06.2016

Still got the same problem,nothing got saved,it only create the player account and loads the default stats and when i leave the server the codes above don't update anything in the table.