mysql saving bug
#1

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

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

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

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

Thanks man....Konstantinos,and a rep for you
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)