#define MAX_CNAME 5; clanData[playerid][cd_cLeader] = 1; format(clanData[playerid][cd_cName], MAX_CNAME, "%s", inputtext); mysql_format(gGameConnection, Query, sizeof(Query), "UPDATE `accounts` SET (`cname`, `cleader`) VALUES ('%e', '%i') WHERE `name` = '%e';", inputtext, clanData[playerid][cd_cLeader], ReturnPlayerName(playerid)); mysql_tquery(gGameConnection, Query);
Check your mysql_log, if you can't get it to work post the logs here.
|
[21:52:09 09/22/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 '`cleader` = 1, WHERE `id` = 190' at line 1 (Query: "UPDATE `accounts` SET `cname` = '[HUH]' `cleader` = 1, WHERE `id` = 190;") [21:56:06 09/22/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 '`cleader` = 1, WHERE `id` = 190' at line 1 (Query: "UPDATE `accounts` SET `cname` = '[HUH]' `cleader` = 1, WHERE `id` = 190;") [22:13:14 09/22/18] [ERROR] CMySQLQuery::Execute[] - (error #1364) Field 'name' doesn't have a default value (Query: "INSERT INTO `accounts` (`cname`, `cleader`) VALUES('[HUH]', '1');") [22:20:40 09/22/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 'WHERE `id` = 190' at line 1 (Query: "INSERT INTO `accounts` (`cname`, `cleader`) VALUES('[HUH]', '1') WHERE `id` = 190;") [22:45:19 09/22/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 '(`cname`, `cleader`) VALUES ('HUH', '1') WHERE `name` = 'testaccount89'' at line 1 (Query: "UPDATE `accounts` SET (`cname`, `cleader`) VALUES ('HUH', '1') WHERE `name` = 'testaccount89';")
UPDATE `accounts` SET `cname` = '%e', `cleader` = '%i' WHERE `name` = '%e';", inputtext, clanData[playerid][cd_cLeader], ReturnPlayerName(playerid));
PHP код:
|
Spoon feeding isn't helping.
@Doddinger: Funny how you completely ignore my reply because people like you expect everything done for you free here, and they get it. |
Your UPDATE syntax is wrong, check this link: https://www.w3schools.com/sql/sql_update.asp
|
Spoon feeding isn't helping.
@Doddinger: Funny how you completely ignore my reply because people like you expect everything done for you free here, and they get it. |