19.04.2018, 21:23
Help please with the solution of the problem in MySQL
MySQL log:
[00:15:36 04/20/18] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`password` = '12345' `PosX` = '0.000000', `PosY` = '0.000000', `PosZ` = '0.00000' at line 1 (Query: "UPDATE `accounts` SET `player_name` = 'Devreyk' `password` = '12345' `PosX` = '0.000000', `PosY` = '0.000000', `PosZ` = '0.000000', WHERE `id` = '0',")
Code:
MySQL log:
[00:15:36 04/20/18] [ERROR] CMySQLQuery::Execute[] - (error #1064) You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`password` = '12345' `PosX` = '0.000000', `PosY` = '0.000000', `PosZ` = '0.00000' at line 1 (Query: "UPDATE `accounts` SET `player_name` = 'Devreyk' `password` = '12345' `PosX` = '0.000000', `PosY` = '0.000000', `PosZ` = '0.000000', WHERE `id` = '0',")
Code:
PHP код:
stock SaveAccount(playerid)
{
new query_string[(256)+(50+11)+(50+MAX_PLAYER_NAME)+(50+30)] = "UPDATE `accounts` SET";
format(query_string, sizeof(query_string), "%s `player_name` = '%s'", query_string, pInfo[playerid][pName]);
format(query_string, sizeof(query_string), "%s `password` = '%s'", query_string, pInfo[playerid][pPassword]);
format(query_string, sizeof(query_string), "%s `PosX` = '%f',", query_string, pInfo[playerid][Pos][0]);
format(query_string, sizeof(query_string), "%s `PosY` = '%f',", query_string, pInfo[playerid][Pos][1]);
format(query_string, sizeof(query_string), "%s `PosZ` = '%f',", query_string, pInfo[playerid][Pos][2]);
format(query_string, sizeof(query_string), "%s WHERE `id` = '%d',", query_string, pInfo[playerid][pID]);
mysql_function_query(mysql_connect_ID, query_string, false, "", "");
SavePos(playerid);
SaveInv(playerid);
return 1;
}