Mysql saving issue
#1

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);
Reply
#2

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

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
Reply
#4

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

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

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

Did u load the accounts?
Reply
#8

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?
Reply
#9

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

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)