format(Query, sizeof(Query), "INSERT INTO `members` (`id`, `playername`, `password`, `email`, `adminlevel`, `viplevel`, `viptime`, `score`, `onlinetime`, `faction`, `staticfaction`, `lastloginevent`, `lastlogineventtime`, `lastwinevent`, `lastwineventtime`, `totaleventcount`,`jailtime`, `deathcount`, `killcount`, `moneycount`, `bankmoneycount`, `nicknamecolor`,`weapon1`, `weapon2`, `weapon3`, `weapon4`, `ammo1`, `ammo2`, `ammo3`, `ammo4`, `skin`, `ingame`, `ip`, `spawnposx`, `spawnposy`, `spawnposz`, `crashx`, `crashy`, `crashz`, `fightstyle`, `homeno`, `stuntpoint`, `eventpoint`,`security`, `old1`, `old2`, `old3`, `old4`, `warningpoint`, `inevent`, `coupon1`, `coupon2`) VALUES (mysql_insert_id()NULL, '%s', '%s', 'yourmail@hotmail.com','0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '5000', '5000', '0xFFFFFFFF', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '%s', '2034.1202', '1007.9800', '10.8203', '2034.1202', '1007.9800', '10.8203','FIGHT_STYLE_NORMAL', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')", escpname, escpass, PIP);
"error 075: input line too long (after substitutions)"
format(Query, sizeof(Query), "INSERT INTO `members` (`id`, `playername`, `password`, `email`, `adminlevel`, `viplevel`, `viptime`, `score`, `onlinetime`, `faction`, `staticfaction`, `lastloginevent`, `lastlogineventtime`, `lastwinevent`, `lastwineventtime`, `totaleventcount`)", escpname, escpass, PIP), format(Query, sizeof(Query), "`jailtime`, `deathcount`, `killcount`, `moneycount`, `bankmoneycount`, `nicknamecolor`,`weapon1`, `weapon2`, `weapon3`, `weapon4`, `ammo1`, `ammo2`, `ammo3`, `ammo4`, `skin`, `ingame`, `ip`, `spawnposx`, `spawnposy`, `spawnposz`, `crashx`, `crashy`, `crashz`, `fightstyle`, `homeno`, `stuntpoint`, `eventpoint`)", escpname, escpass, PIP), format(Query, sizeof(Query), "`security`, `old1`, `old2`, `old3`, `old4`, `warningpoint`, `inevent`, `coupon1`, `coupon2`) VALUES (mysql_insert_id()NULL, '%s', '%s', 'yourmail@hotmail.com')", escpname, escpass, PIP), format(Query, sizeof(Query), "'0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '5000', '5000', '0xFFFFFFFF', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '%s', '2034.1202', '1007.9800', '10.8203', '2034.1202', '1007.9800', '10.8203')", escpname, escpass, PIP); format(Query, sizeof(Query), "'FIGHT_STYLE_NORMAL', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')", escpname, escpass, PIP);
format(query, sizeof(query), "INSERT INTO `players` (name, password, ip) VALUES ('%s', md5('%s'), '%s')", name, pw, ip);
What he said.
I'm looking at your code and i assume you want to do this when the player is registering? Then why are you inserting so many variables? you only update like 3. |
format(Query, sizeof(Query), "INSERT INTO `members` (`id`, `playername`, `password`, `email`, `adminlevel`, `viplevel`, `viptime`, `score`, `onlinetime`, `faction`, `staticfaction`, `lastloginevent`, `lastlogineventtime`, `lastwinevent`, `lastwineventtime`, `totaleventcount`,`jailtime`, `deathcount`, `killcount`, `moneycount`, `bankmoneycount`, `nicknamecolor`,`weapon1`, `weapon2`) VALUES (mysql_insert_id()NULL, '%s', '%s', 'yourmail@hotmail.com','0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '5000', '5000', '0xFFFFFFFF', '0', '0');
format(Query, sizeof(Query), "INSERT INTO `members` (`weapon3`, `weapon4`, `ammo1`, `ammo2`, `ammo3`, `ammo4`, `skin`, `ingame`, `ip`, `spawnposx`, `spawnposy`, `spawnposz`, `crashx`, `crashy`, `crashz`, `fightstyle`, `homeno`, `stuntpoint`, `eventpoint`,`security`, `old1`, `old2`, `old3`, `old4`, `warningpoint`, `inevent`, `coupon1`, `coupon2`) VALUES ('0', '0', '0', '0', '0', '0', '0', '1', '%s', '2034.1202', '1007.9800', '10.8203', '2034.1202', '1007.9800', '10.8203','FIGHT_STYLE_NORMAL', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')", escpname, escpass, PIP);
For example, I've made a query from the first 24 columns and the second query from the other ones.
Part 1: Код:
format(Query, sizeof(Query), "INSERT INTO `members` (`id`, `playername`, `password`, `email`, `adminlevel`, `viplevel`, `viptime`, `score`, `onlinetime`, `faction`, `staticfaction`, `lastloginevent`, `lastlogineventtime`, `lastwinevent`, `lastwineventtime`, `totaleventcount`,`jailtime`, `deathcount`, `killcount`, `moneycount`, `bankmoneycount`, `nicknamecolor`,`weapon1`, `weapon2`) VALUES (mysql_insert_id()NULL, '%s', '%s', 'yourmail@hotmail.com','0', '0', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '5000', '5000', '0xFFFFFFFF', '0', '0'); Код:
format(Query, sizeof(Query), "INSERT INTO `members` (`weapon3`, `weapon4`, `ammo1`, `ammo2`, `ammo3`, `ammo4`, `skin`, `ingame`, `ip`, `spawnposx`, `spawnposy`, `spawnposz`, `crashx`, `crashy`, `crashz`, `fightstyle`, `homeno`, `stuntpoint`, `eventpoint`,`security`, `old1`, `old2`, `old3`, `old4`, `warningpoint`, `inevent`, `coupon1`, `coupon2`) VALUES ('0', '0', '0', '0', '0', '0', '0', '1', '%s', '2034.1202', '1007.9800', '10.8203', '2034.1202', '1007.9800', '10.8203','FIGHT_STYLE_NORMAL', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')", escpname, escpass, PIP); |
If you are setting values for all the columns you don't need to specify them, just write them all in the correct order.
|
format(Query, sizeof(Query), "INSERT INTO `members` (`playername`, `password`, `email`) VALUES ( '%s', '%s', '%s'",name,pass, email);