mysql saving bug - 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 bug (
/showthread.php?tid=571003)
mysql saving bug -
iBots - 15.04.2015
well,here is my code for saving under onplayerdisconnect:
pawn Код:
new query[128];
mysql_format(mysql, query, sizeof(query), "UPDATE `accounts` SET `AdminLevel`=%d WHERE `Name`=%e",\
pInfo[playerid][AdminLevel], pInfo[playerid][Name]);
mysql_tquery(mysql, query, "", "");
printf("saved id %d", playerid);
it prints but not save to database,when i login it loads and when i register it types and..but when i disconnect it doesnt save
Re: mysql saving bug -
iBots - 15.04.2015
this is in mysql_log...
pawn Код:
[DEBUG] mysql_format - connection: 1, len: 128, format: "UPDATE `accounts` SET `AdminLevel`=%d WHERE `Name`=%e"
[DEBUG] mysql_tquery - connection: 1, query: "UPDATE `accounts` SET `AdminLevel`=2 WHERE `Name`=Test", callback: "(null)", format: "(null)"
[DEBUG] CMySQLQuery::Execute[] - starting query execution
[DEBUG] CMySQLQuery::Execute[] - query was successfully executed within 0.317 milliseconds
[DEBUG] CMySQLQuery::Execute[] - no callback specified, skipping result saving
Re: mysql saving bug -
zT KiNgKoNg - 15.04.2015
Just because you debug your code, you should put it on every line that you're doing your query excluding any part that is formatting to a string.... But your best bet is using the Error function to display specific errors that can help you debug.....
But by the looks of it, you haven't specified a "NULL" callback for it to use.. (EG: public MySQLEmpty)
Re: mysql saving bug -
Konstantinos - 15.04.2015
When using
%s or
%e in
mysql_format, use
' ' around them. For example, "... WHERE `Name`='%e'"
@zT KiNgKoNg: It's not necessary to use a callback to INSERT/UPDATE/DELETE queries.
Re: mysql saving bug -
iBots - 15.04.2015
Thanks man....Konstantinos,and a rep for you