How can I avoid "input line too long"
#1

Hey, so I've tried multiple things to avoid the input line too long error, but I end up with a not working script. The code under us is working fine, but it's limited, with that I mean if I want more data to save I get the input line too long error. So my question is how can I avoid the error and make the script work at the same time. I tried using strcat and many more but I'm pretty much desperate.

pawn Код:
mysql_format(sqlid,query,sizeof(query),"UPDATE `users` SET `px` = %f,`py` = %f,`pz` = %f,`pa` = %f,`hp` = %f,`armor` = %f WHERE username = '%e'",\
    PlayerInfo[playerid][pPosX],
    PlayerInfo[playerid][pPosY],
    PlayerInfo[playerid][pPosZ],
    PlayerInfo[playerid][pPosA],
    PlayerInfo[playerid][pHealth],
    PlayerInfo[playerid][pArmor],
    GPN(playerid));
    mysql_tquery(sqlid,query, "", "");
Reply
#2

Have you tried to "split" the string using " \ "(without quotationmarks) ?
"My name \
is Jason"
Reply
#3

Yea, the backslashes didn't remove the error for me.
Reply
#4

Example code

pawn Код:
new strcatstring[300];
mysql_format(mysql, strcatstring, sizeof(strcatstring), "UPDATE `users` SET `score`=%d, `money`=%d,",
GetPlayerScore(playerid),GetPlayerMoney(playerid), /* variables*/);
strcat(query, strcatstring);
       
mysql_format(mysql, strcatstring, sizeof(strcatstring), "`x`=%d, `y`=%d, `z`=%d WHERE username = '%e'",
PlayerInfo[playerid][x],/* variables*/);
strcat(query, strcatstring);

mysql_tquery(mysql, query, "", "");
Reply
#5

pawn Код:
GetPlayerPos(playerid,PlayerInfo[playerid][pPosX],PlayerInfo[playerid][pPosY],PlayerInfo[playerid][pPosZ]);
    GetPlayerFacingAngle(playerid,PlayerInfo[playerid][pPosA]);
    GetPlayerHealth(playerid,PlayerInfo[playerid][pHealth]);
    GetPlayerArmour(playerid,PlayerInfo[playerid][pArmor]);
    new strcatstring[300];
    mysql_format(sqlid,strcatstring, sizeof(strcatstring),"UPDATE `users` SET `px`=%f,`py`=%f,`pz`=%f",
    PlayerInfo[playerid][pPosX],
    PlayerInfo[playerid][pPosY],
    PlayerInfo[playerid][pPosZ],
    PlayerInfo[playerid][pPosA]);
    strcat(query,strcatstring);
    mysql_format(sqlid,strcatstring, sizeof(strcatstring), "`hp`=%f, `armor`=%f WHERE username = '%e'",
    PlayerInfo[playerid][pHealth],
    PlayerInfo[playerid][pArmor],
    GPN(playerid));
    strcat(query,strcatstring);
    mysql_tquery(sqlid,query, "", "");
Not sure if I did it right, it won't work for me.
Reply
#6

You have missed a coma at the ending.
pawn Код:
"UPDATE `users` SET `px`=%f,`py`=%f,`pz`=%f,"
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)