SA-MP Forums Archive
Input line too long - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Input line too long (/showthread.php?tid=492292)



Input line too long - Face9000 - 03.02.2014

Got some problems:

error 075: input line too long (after substitutions)
error 037: invalid string (possibly non-terminated string)

at this lines:

pawn Код:
WP_Hash(PlayerInfo[playerid][Password], 129, inputtext);
            mysql_format(mysqlc, query, sizeof(query),"INSERT INTO playerdata(user, password, Scores, Cash, Admin, Deaths, Nopm, Muted, Vip, Warn, RegisterDate, Jailed, AdminActions, Cookies, Rank, VipTime, Class, PrototypesStolen, KillAsUsaTeam, KillAsGermanyTeam, KillAsItalyTeam, KillAsJapanTeam, KillAsMercTeam, KillAsMexicoTeam, IP, DaysAlive, Banned, PlayersBanned, PlayersKicked, PlayersMuted, PlayersWarned, TimesKicked) VALUES('%e', '%e', 0, 0, 0, 0, 0, 0, 0, 0, '%e', 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '%e', '0', '0', '0', '0', '0', '0', '0')",
            pname, PlayerInfo[playerid][Password], InsertTimeStamp(), IP);
            mysql_tquery(mysqlc, query, "", "");
            mysql_real_escape_string(inputtext,query);
What's wrong?


Re: Input line too long - Konstantinos - 03.02.2014

The line is too long. Use default values for the fields while creating the table so all you'd need to do is just:
pawn Код:
mysql_format(mysqlc, query, sizeof(query), "INSERT INTO playerdata(user, password, RegisterDate, IP) VALUES('%e', '%s', '%e', '%s')", pname, PlayerInfo[playerid][Password], InsertTimeStamp(), IP);



Re: Input line too long - Face9000 - 03.02.2014

What about other stats? I need to set them to 0 when someone register. I currently have this:

pawn Код:
PlayerInfo[playerid][Admin] = 0;
            PlayerInfo[playerid][Deaths] = 0;
            PlayerInfo[playerid][Nopm] = 0;
            PlayerInfo[playerid][Muted] = 0;
            PlayerInfo[playerid][Vip] = 0;
            PlayerInfo[playerid][Warn] = 0;
            PlayerInfo[playerid][RegisterDate] = 0;
            PlayerInfo[playerid][Jailed] = 0;
            PlayerInfo[playerid][AdminActions] = 0;
After that query.

I leave it as they are?


Re: Input line too long - PowerPC603 - 03.02.2014

Just adjust your tables to have a default value of '0' for all your stats, money, score, ...
When registering, those values should be '0' anyway.
Then you only need to save the player's name and password, and perhaps a few others, like your timestamp and IP.
When inserting a new row into a column, MySQL automatically sets the fields to their default value you specified when you don't include them in your query.


Re: Input line too long - Face9000 - 03.02.2014

Oh, all is clear now. Thanks.