public OnPlayerDisconnect(playerid, reason) { new query[128], aName[MAX_PLAYER_NAME]; GetPlayerName(playerid, aName, sizeof(aName)); mysql_format(mysql, query, sizeof(query), "UPDATE `accounts` SET (`AdminLevel`, `Age`, `Gender`, `Skin`) VALUES ('%i', '%i', '%i', '%i') WHERE `Username` = '%s'", pInfo[playerid][AdminLevel], pInfo[playerid][Age], pInfo[playerid][Gender], pInfo[playerid][Skin], aName); mysql_tquery(mysql, query); return 1; }
[23:49:22] [DEBUG] mysql_format - connection: 1, len: 128, format: "UPDATE `accounts` SET (`AdminLevel`, `Age`, `Gender`, `Skin`) VALUES ('%i', '%i', '%i', '%i') WHERE `Username` = '%s'" [23:49:22] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `accounts` SET (`AdminLevel`, `Age`, `Gender`, `Skin`) VA", callback: "(null)", format: "(null)" [23:49:22] [DEBUG] CMySQLQuery::Execute[] - starting query execution [23:49:22] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(`AdminLevel`, `Age`, `Gender`, `Skin`) VALUES ('0', '16', '1', '60') WHERE `Use' at line 1 [23:49:22] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError
[00:01:20] [DEBUG] mysql_format - connection: 1, len: 128, format: "UPDATE `accounts` SET (`AdminLevel`, `Age`, `Gender`, `Skin`) VALUES ('%d', '%d', '%d', '%d') WHERE `Username` = '%s'" [00:01:20] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `accounts` SET (`AdminLevel`, `Age`, `Gender`, `Skin`) VA", callback: "(null)", format: "(null)" [00:01:20] [DEBUG] CMySQLQuery::Execute[] - starting query execution [00:01:20] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(`AdminLevel`, `Age`, `Gender`, `Skin`) VALUES ('0', '16', '1', '60') WHERE `Use' at line 1 [00:01:20] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError
UPDATE `accounts` SET (`AdminLevel`, `Age`, `Gender`, `Skin`) VALUES ('%i', '%i', '%i', '%i') WHERE `Username` = '%s'
by the way:
that: PHP код:
assume the maximum of characters in names is 24 (MAX_PLAYER_NAME), you exceeds the new query [128]; |