[Help] MySQL String formatting for query.
#1

Alright then, first off thanks for your interest.
I'm a newb at MySQL.. -.-, and could use some help with the following:

pawn Код:
error 075: input line too long (after substitutions)
Pretty sure it has to with the array size but for the life of me I can't seem to fix it.
pawn Код:
new string[256];
/*Error here*/  format(string, sizeof(string), "UPDATE Users SET Password='%s',AdminLevel='%d',Cash='%d',Regged='%d',Level='%d',Kills='%d',Locked='%d',Int='%d',Local='%d',Mats='%d',MiserPerk='%d',Deaths='%d',IP='%s' WHERE Name='%s'", PlayerShit[playerid][PLAYER_PASS], PlayerShit[playerid][PLAYER_ADMINLEVEL], PlayerShit[playerid][PLAYER_CASH], PlayerShit[playerid][PLAYER_REGGED], PlayerShit[playerid][PLAYER_LEVEL], PlayerShit[playerid][PLAYER_KILLS], PlayerShit[playerid][PLAYER_LOCKED], PlayerShit[playerid][PLAYER_INT], PlayerShit[playerid][PLAYER_LOCAL], PlayerShit[playerid][PLAYER_MATS], PlayerShit[playerid][PLAYER_MISERPERK], PlayerShit[playerid][PLAYER_DEATHS], PlayerShit[playerid][PLAYER_IP], PlayerShit[playerid][PLAYER_NAME]);
    mysql_query(string);
    return 1;
Reply
#2

Instead of reading your query, you could tell us what you need help with. I don't plan on wasting my time reading 256 characters due to your poor explanation.
Reply
#3

Sorry, just flew over my head.

pawn Код:
error 075: input line too long (after substitutions)
This is on the formatting line.
Reply
#4

Fixed the issue:

pawn Код:
new string[256];
    format(string, sizeof(string), "UPDATE Users SET Password='%s',AdminLevel='%d',Cash='%d',Regged='%d',Level='%d',Kills='%d',Locked='%d',Int='%d',Local='%d',Mats='%d',MiserPerk='%d',Deaths='%d',IP='%s' WHERE Name='%s'",
    PlayerShit[playerid][PLAYER_PASS], PlayerShit[playerid][PLAYER_ADMINLEVEL], PlayerShit[playerid][PLAYER_CASH], PlayerShit[playerid][PLAYER_REGGED], PlayerShit[playerid][PLAYER_LEVEL], PlayerShit[playerid][PLAYER_KILLS], PlayerShit[playerid][PLAYER_LOCKED], PlayerShit[playerid][PLAYER_INT], PlayerShit[playerid][PLAYER_LOCAL], PlayerShit[playerid][PLAYER_MATS], PlayerShit[playerid][PLAYER_MISERPERK], PlayerShit[playerid][PLAYER_DEATHS], PlayerShit[playerid][PLAYER_IP], PlayerShit[playerid][PLAYER_NAME]);
    mysql_query(string);
    return 1;
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)