(665) : error 075: input line too long (after substitutions) (666) : error 017: undefined symbol "pBanne" (667) : warning 217: loose indentation (667) : error 017: undefined symbol "dAdminName" (667) : error 029: invalid expression, assumed zero (667) : error 029: invalid expression, assumed zero (667) : fatal error 107: too many error messages on one line
new query[512]; // this is line 664 mysql_format(mysql, query, sizeof(query), "UPDATE `users` SET `IP`=%s`Admin`=%d,`Money`=%d,`Level`=%d,`Kills`=%d,`Deaths`=%d,`Warns`=%d,`Banned`=%d,`BannedReason`=%s,`BannedBy`=%s,`Beta`=%d,`Faction`=%d,`FactionRank`=%s,`FactionRight`=%d, WHERE `ID`=%d",\ IP[playerid], PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pScores], PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pWarns],PlayerInfo[playerid][pBanned],PlayerInfo[playerid][pBanReason],PlayerInfo[playerid][pBannedAdminName],PlayerInfo[playerid][pBeta],PlayerInfo[playerid][pFaction], PlayerInfo[playerid][pFactionRank],PlayerInfo[playerid][pFactionRight], PlayerInfo[playerid][ID]); mysql_tquery(mysql, query, "", "");
The input in the format is too much long, and so also the others error are due to this problem. To fix this, you can use strins or alternatively you can do two different queries to split the other one..
|
Also about the two different queries; would it decrease performance?
|
Could you tell me what strins are?
Also about the two different queries; would it decrease performance? |
new string[512];
  strins(string,"UPDATE `users` SET `IP`=%s`Admin`=%d,`Money`=%d,`Level`=%d,`Kills`=%d,`Deaths`=%d,`Warns`=%d,`Banned`=%d,`BannedReason`=%s,`BannedBy`=%s,",strlen(string));
  strins(string,"`Beta`=%d,`Faction`=%d,`FactionRank`=%s,`FactionRight`=%d, WHERE `ID`=%d",strlen(string));
  new query[512]; // this is line 664
  format(query, sizeof(query), string, IP[playerid], PlayerInfo[playerid][pAdmin], PlayerInfo[playerid][pScores], PlayerInfo[playerid][pKills],PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pWarns],PlayerInfo[playerid][pBanned],PlayerInfo[playerid][pBanReason],PlayerInfo[playerid][pBannedAdminName],PlayerInfo[playerid][pBeta],PlayerInfo[playerid][pFaction], PlayerInfo[playerid][pFactionRank],PlayerInfo[playerid][pFactionRight], PlayerInfo[playerid][ID]);
  mysql_query(query);
https://sampwiki.blast.hk/wiki/Strins
Try in this way: pawn Код:
|
// (671) : error 035: argument type mismatch (argument 1) mysql_query(query);
mysql_tquery(mysql, query, "", "");
WP_Hash(pass, sizeof(pass), inputtext);
                mysql_format(mysql, query, sizeof(query), "INSERT INTO `users` (`Username`, `Password`, `IP`, `Admin`, `Money`, `Level`, `Kills`, `Deaths`, `Warns`, `Banned`, `BanReason`, `BannedBy`, `Beta`, `Faction`, `FactionRank`, `FactionRight`) VALUES ('%e', '%s', '%s', 0, 0, 1, 0, 0, 0, 0, '%s', '%s', 0, -1, '%s', -1)", Name[playerid], pass, IP[playerid], Empty, Empty, Empty);
                mysql_tquery(mysql, query, "OnAccountRegister", "i", playerid);Â
                new hpass[129];
                WP_Hash(hpass, 129, inputtext);
                if(!strcmp(hpass, PlayerInfo[playerid][pPass]))
                {
                    new query[100];
                    mysql_format(mysql, query, sizeof(query), "SELECT * FROM `users` WHERE `Username` = '%e' LIMIT 1", Name[playerid]);
                    mysql_tquery(mysql, query, "OnAccountLoad", "i", playerid);
                    PassWordSecure[playerid] = 1;
                }Â
[23:16:37] [DEBUG] mysql_connect - host: "localhost", user: "root", database: "Database_DRP", password: "****", port: 3306, autoreconnect: true, pool_size: 2 [23:16:37] [DEBUG] CMySQLHandle::Create - creating new connection.. [23:16:37] [DEBUG] CMySQLHandle::CMySQLHandle - constructor called [23:16:37] [DEBUG] CMySQLHandle::Create - connection created (id: 1) [23:16:37] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [23:16:37] [DEBUG] CMySQLConnection::Connect - connection was successful [23:16:37] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [23:16:37] [DEBUG] mysql_errno - connection: 1 [23:16:37] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [23:16:37] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [23:16:37] [DEBUG] CMySQLConnection::Connect - establishing connection to database... [23:16:37] [DEBUG] CMySQLConnection::Connect - connection was successful [23:16:37] [DEBUG] CMySQLConnection::Connect - connection was successful [23:16:37] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [23:16:37] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [23:16:37] [DEBUG] CMySQLConnection::Connect - auto-reconnect has been enabled [23:17:13] [DEBUG] mysql_format - connection: 1, len: 512, format: "SELECT `Password`, `ID` FROM `users` WHERE `Username` = '%e' LIMIT 1" [23:17:13] [DEBUG] mysql_tquery - connection: 1, query: "SELECT `Password`, `ID` FROM `users` WHERE `Username` = 'Yo_Momm", callback: "OnAccountCheck", format: "i" [23:17:13] [DEBUG] CMySQLQuery::Execute[OnAccountCheck] - starting query execution [23:17:13] [DEBUG] CMySQLQuery::Execute[OnAccountCheck] - query was successfully executed within 0.280 milliseconds [23:17:13] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [23:17:13] [DEBUG] Calling callback "OnAccountCheck".. [23:17:13] [DEBUG] cache_get_data - connection: 1 [23:17:13] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [23:17:18] [DEBUG] mysql_format - connection: 1, len: 300, format: "INSERT INTO `users` (`Username`, `Password`, `IP`, `Admin`, `Money`, `Level`, `Kills`, `Deaths`, `Warns`, `Banned`, `BanReason`,..." [23:17:18] [DEBUG] mysql_tquery - connection: 1, query: "INSERT INTO `users` (`Username`, `Password`, `IP`, `Admin`, `Mon", callback: "OnAccountRegister", format: "i" [23:17:18] [DEBUG] CMySQLQuery::Execute[OnAccountRegister] - starting query execution [23:17:18] [DEBUG] CMySQLQuery::Execute[OnAccountRegister] - query was successfully executed within 118.86 milliseconds [23:17:18] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [23:17:18] [DEBUG] Calling callback "OnAccountRegister".. [23:17:18] [DEBUG] cache_insert_id - connection: 1 [23:17:18] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [23:17:21] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `users` SET `IP`=127.0.0.1 `Admin`=0, `Money`=0, `Level`=", callback: "(null)", format: "(null)" [23:17:21] [DEBUG] CMySQLQuery::Execute[] - starting query execution [23:17:21] [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 '.0.1 `Admin`=0, `Money`=0, `Level`=0, `Kills`=0, `Deaths`=0, `Warns`=0, `Banned`' at line 1 [23:17:21] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError [23:17:48] [DEBUG] mysql_format - connection: 1, len: 512, format: "SELECT `Password`, `ID` FROM `users` WHERE `Username` = '%e' LIMIT 1" [23:17:48] [DEBUG] mysql_tquery - connection: 1, query: "SELECT `Password`, `ID` FROM `users` WHERE `Username` = 'Yo_Momm", callback: "OnAccountCheck", format: "i" [23:17:48] [DEBUG] CMySQLQuery::Execute[OnAccountCheck] - starting query execution [23:17:48] [DEBUG] CMySQLQuery::Execute[OnAccountCheck] - query was successfully executed within 0.251 milliseconds [23:17:48] [DEBUG] CMySQLResult::CMySQLResult() - constructor called [23:17:48] [DEBUG] Calling callback "OnAccountCheck".. [23:17:48] [DEBUG] cache_get_data - connection: 1 [23:17:48] [DEBUG] cache_get_field_content - row: 0, field_name: "Password", connection: 129, max_len: 1 [23:17:48] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "Password", data: "" [23:17:48] [DEBUG] cache_get_field_content_int - row: 0, field_name: "ID", connection: 1 [23:17:48] [DEBUG] CMySQLResult::GetRowDataByName - row: '0', field: "ID", data: "11" [23:17:48] [DEBUG] CMySQLResult::~CMySQLResult() - deconstructor called [23:28:19] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `users` SET `IP`=127.0.0.1 `Admin`=-1, `Money`=-1, `Level", callback: "(null)", format: "(null)" [23:28:19] [DEBUG] CMySQLQuery::Execute[] - starting query execution [23:28:19] [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 '.0.1 `Admin`=-1, `Money`=-1, `Level`=-1, `Kills`=-1, `Deaths`=-1, `Warns`=-1, `B' at line 1 [23:28:19] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError