Input line too long
#1

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?
Reply
#2

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);
Reply
#3

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?
Reply
#4

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.
Reply
#5

Oh, all is clear now. Thanks.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)