(MySql) input line too long
#5

Quote:
Originally Posted by InglewoodRoleplay
View Post
Why are you using PlayerQuery[999][MAXPLAYERS]?
Try defining
pawn Code:
new SQLQuery[2048]; //(I know it's too big) at the top of your script
and then use it for your queries. See if that still happens. I don't think it makes much sense to use that PlayerQuery you're using for each player since it's just a server string that gets sent to SQL.
Then to free your string you can use:
pawn Code:
SQLQuery[0] = 0; //(Before you format it, of course.)
mysql_format(mysqlConnectHandle, SQLQuery, sizeof(SQLQuery), "INSERT INTO `playerinfo` (`ipAdress`, `name`, `password`, `admin`, `moderator`, `vip`, `credits`, `language`, `timeMuted`, `timeJailed`, `banned`, `skin`, `spawnInterior`) VALUES ('%s', '%e', sha1('%e'), '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i')", PlayerInfo[playerid][ipAdress], PlayerInfo[playerid][name], PlayerInfo[playerid][password], PlayerInfo[playerid][admin], PlayerInfo[playerid][moderator], PlayerInfo[playerid][vip], PlayerInfo[playerid][credits], PlayerInfo[playerid][language], PlayerInfo[playerid][timeMuted], PlayerInfo[playerid][timeJailed], PlayerInfo[playerid][banned], PlayerInfo[playerid][skin], PlayerInfo[playerid][spawnInterior]);
mysql_tquery(mysqlConnectHandle, SQLQuery, "", "");
If possible tell me what parameters mysql_tquery accepts since that may be part of the problem as well.
Now I put thus but have the same error "error 075: input line too long (after substitutions)"

Code:
new SQLQuery[2048];

SQLQuery[0] = 0;
mysql_format(mysqlConnectHandle, SQLQuery, sizeof(SQLQuery), "INSERT INTO `playerinfo` (`ipAdress`, `name`, `password`, `admin`, `moderator`, `vip`, `credits`, `language`, `timeMuted`, `timeJailed`, `banned`, `skin`, `spawnInterior`) VALUES ('%s', '%e', sha1('%e'), '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i', '%i')", PlayerInfo[playerid][ipAdress], PlayerInfo[playerid][name], PlayerInfo[playerid][password], PlayerInfo[playerid][admin], PlayerInfo[playerid][moderator], PlayerInfo[playerid][vip], PlayerInfo[playerid][credits], PlayerInfo[playerid][language], PlayerInfo[playerid][timeMuted], PlayerInfo[playerid][timeJailed], PlayerInfo[playerid][banned], PlayerInfo[playerid][skin], PlayerInfo[playerid][spawnInterior]);
mysql_tquery(mysqlConnectHandle, SQLQuery, "", "");
I think the problem not is in variable, is in the line size because even if the variable has any size have the same problem and if I decrease the content of the line I don't have more any error.

Code:
mysql_format(mysqlConnectHandle, SQLQuery, sizeof(SQLQuery), "INSERT INTO `playerinfo` (`ipAdress`, `name`, `password`, `admin`, `moderator`, `vip`, `credits`, `language`) VALUES ('%s', '%e', sha1('%e'), '%i', '%i', '%i', '%i', '%i')", PlayerInfo[playerid][ipAdress], PlayerInfo[playerid][name], PlayerInfo[playerid][password], PlayerInfo[playerid][admin], PlayerInfo[playerid][moderator], PlayerInfo[playerid][vip], PlayerInfo[playerid][credits], PlayerInfo[playerid][language]); //Withdrawn: PlayerInfo[playerid][timeMuted], PlayerInfo[playerid][timeJailed], PlayerInfo[playerid][banned], PlayerInfo[playerid][skin], PlayerInfo[playerid][spawnInterior]
mysql_tquery(mysqlConnectHandle, SQLQuery, "", "");
--------------------------

Code:
mysql_tquery(connectionHandle, query[], callback[], format[], {Float,_}:...)
connectionHandle The connection handle this will be processed on.
query[] The query you want to execute.
callback[] The query you want to process.
format[] The format specifier string.
{Float,_}:... Indefinite number of arguments.

Returns 1 on success, 0 on fail.
Reply


Messages In This Thread
(MySql) input line too long - by goldspy98 - 20.11.2013, 20:11
Re: (MySql) input line too long - by InglewoodRoleplay - 20.11.2013, 21:01
Re: (MySql) input line too long - by goldspy98 - 20.11.2013, 21:30
Re: (MySql) input line too long - by InglewoodRoleplay - 20.11.2013, 21:49
Re: (MySql) input line too long - by goldspy98 - 20.11.2013, 22:01
Re: (MySql) input line too long - by InglewoodRoleplay - 20.11.2013, 22:09
Re: (MySql) input line too long - by goldspy98 - 20.11.2013, 22:13
Re: (MySql) input line too long - by InglewoodRoleplay - 20.11.2013, 22:19
Re: (MySql) input line too long - by goldspy98 - 20.11.2013, 22:23
Re: (MySql) input line too long - by InglewoodRoleplay - 20.11.2013, 22:26

Forum Jump:


Users browsing this thread: 3 Guest(s)