Mysql input line to long help
#1

Heres the code:
pawn Code:
new saveQuery2[200];
        format(saveQuery, sizeof(saveQuery), "%s, playerPhoneBook = '%d', playerGroup = '%d', playerGroupRank = '%d', playerIP = '%s', playerDropCarTimeout = '%d', playerHotwireTime = '%d', playerRope = '%d', playerVehicleParts = '%d', playerScrewDriver = '%d', playerGasCan = '%d', playerSprayCan = '%d', playerToolKit= '%d', playerIdentification = '%d',playerAdminDuty = '%d', playerCrimes = '%d', playerArrests = '%d', playerWarrants = '%d', playerAge = '%d', playerVIPtokens = '%d',  playerRags = '%d', playerCarEngineStatus = '%d', playerFuel = '%d'"
        , saveQuery, playerVariables[playerid][pPhoneBook], playerVariables[playerid][pGroup]
        , playerVariables[playerid][pGroupRank], playerVariables[playerid][pConnectionIP]
        , playerVariables[playerid][pDropCarTimeout], playerVariables[playerid][pHotwireTime]
        , playerVariables[playerid][pRope], playerVariables[playerid][pVehicleParts]
        , playerVariables[playerid][pScrewDriver], playerVariables[playerid][pGasCan]
        , playerVariables[playerid][pSprayCan], playerVariables[playerid][pToolKit]
        , playerVariables[playerid][pIdentification], playerVariables[playerid][pAdminDuty]
        , playerVariables[playerid][pCrimes], playerVariables[playerid][pArrests]
        , playerVariables[playerid][pWarrants], playerVariables[playerid][pAge]
        , playerVariables[playerid][pVIPtokens], playerVariables[playerid][pRags]
        , playerVariables[playerid][pCarEngineStatua], playerVariables[playerid][fuel]);
Heres the errors:
pawn Code:
5585) : error 075: input line too long (after substitutions)
(5586) : error 037: invalid string (possibly non-terminated string)
(5586) : warning 215: expression has no effect
(5586) : error 001: expected token: ";", but found "-identifier-"
(5586) : error 017: undefined symbol "d"
(5586) : fatal error 107: too many error messages on one line
Reply
#2

Use strcat(...
Reply
#3

You're going to have to use multiple formats so that it does not exceed the max line length.

pawn Code:
new saveQuery2[200];
        format(saveQuery, sizeof(saveQuery), "%s, playerPhoneBook = '%d', playerGroup = '%d', playerGroupRank = '%d', playerIP = '%s', playerDropCarTimeout = '%d', playerHotwireTime = '%d', playerRope = '%d', playerVehicleParts = '%d', playerScrewDriver = '%d', playerGasCan = '%d', playerSprayCan = '%d', playerToolKit= '%d'"
        , saveQuery, playerVariables[playerid][pPhoneBook], playerVariables[playerid][pGroup]
        , playerVariables[playerid][pGroupRank], playerVariables[playerid][pConnectionIP]
        , playerVariables[playerid][pDropCarTimeout], playerVariables[playerid][pHotwireTime]
        , playerVariables[playerid][pRope], playerVariables[playerid][pVehicleParts]
        , playerVariables[playerid][pScrewDriver], playerVariables[playerid][pGasCan]
        , playerVariables[playerid][pSprayCan], playerVariables[playerid][pToolKit]);


        format(saveQuery, sizeof(saveQuery), "%s, playerIdentification = '%d',playerAdminDuty = '%d', playerCrimes = '%d', playerArrests = '%d', playerWarrants = '%d', playerAge = '%d', playerVIPtokens = '%d',  playerRags = '%d', playerCarEngineStatus = '%d', playerFuel = '%d'"
        , saveQuery
        , playerVariables[playerid][pIdentification], playerVariables[playerid][pAdminDuty]
        , playerVariables[playerid][pCrimes], playerVariables[playerid][pArrests]
        , playerVariables[playerid][pWarrants], playerVariables[playerid][pAge]
        , playerVariables[playerid][pVIPtokens], playerVariables[playerid][pRags]
        , playerVariables[playerid][pCarEngineStatua], playerVariables[playerid][fuel]);
Reply
#4

Quote:
Originally Posted by [HiC]TheKiller
View Post
pawn Code:
new saveQuery2[00];
lol, you've got a typing mistake there!

pawn Code:
// --
        new saveQuery2[200];
        format(saveQuery, sizeof(saveQuery), "%s, playerPhoneBook = '%d', playerGroup = '%d', playerGroupRank = '%d', playerIP = '%s', playerDropCarTimeout = '%d', \
        playerHotwireTime = '%d', playerRope = '%d', playerVehicleParts = '%d', playerScrewDriver = '%d', playerGasCan = '%d', playerSprayCan = '%d', \
        playerToolKit= '%d', playerIdentification = '%d',playerAdminDuty = '%d', playerCrimes = '%d', playerArrests = '%d', playerWarrants = '%d', playerAge = '%d', \
        playerVIPtokens = '%d',  playerRags = '%d', playerCarEngineStatus = '%d', playerFuel = '%d'"

        , saveQuery, playerVariables[playerid][pPhoneBook], playerVariables[playerid][pGroup]
        , playerVariables[playerid][pGroupRank], playerVariables[playerid][pConnectionIP]
        , playerVariables[playerid][pDropCarTimeout], playerVariables[playerid][pHotwireTime]
        , playerVariables[playerid][pRope], playerVariables[playerid][pVehicleParts]
        , playerVariables[playerid][pScrewDriver], playerVariables[playerid][pGasCan]
        , playerVariables[playerid][pSprayCan], playerVariables[playerid][pToolKit]
        , playerVariables[playerid][pIdentification], playerVariables[playerid][pAdminDuty]
        , playerVariables[playerid][pCrimes], playerVariables[playerid][pArrests]
        , playerVariables[playerid][pWarrants], playerVariables[playerid][pAge]
        , playerVariables[playerid][pVIPtokens], playerVariables[playerid][pRags]
        , playerVariables[playerid][pCarEngineStatua], playerVariables[playerid][fuel]);
Reply
#5

You can use \ too instead of strcat.

EDIT:
NVM late post .
Reply
#6

Just dont forget to escape strings

mysql_real_escape_string();
Reply
#7

Quote:
Originally Posted by Dwane
View Post
lol, you've got a typing mistake there!

pawn Code:
// --
        new saveQuery2[200];
        format(saveQuery, sizeof(saveQuery), "%s, playerPhoneBook = '%d', playerGroup = '%d', playerGroupRank = '%d', playerIP = '%s', playerDropCarTimeout = '%d', \
        playerHotwireTime = '%d', playerRope = '%d', playerVehicleParts = '%d', playerScrewDriver = '%d', playerGasCan = '%d', playerSprayCan = '%d', \
        playerToolKit= '%d', playerIdentification = '%d',playerAdminDuty = '%d', playerCrimes = '%d', playerArrests = '%d', playerWarrants = '%d', playerAge = '%d', \
        playerVIPtokens = '%d',  playerRags = '%d', playerCarEngineStatus = '%d', playerFuel = '%d'"

        , saveQuery, playerVariables[playerid][pPhoneBook], playerVariables[playerid][pGroup]
        , playerVariables[playerid][pGroupRank], playerVariables[playerid][pConnectionIP]
        , playerVariables[playerid][pDropCarTimeout], playerVariables[playerid][pHotwireTime]
        , playerVariables[playerid][pRope], playerVariables[playerid][pVehicleParts]
        , playerVariables[playerid][pScrewDriver], playerVariables[playerid][pGasCan]
        , playerVariables[playerid][pSprayCan], playerVariables[playerid][pToolKit]
        , playerVariables[playerid][pIdentification], playerVariables[playerid][pAdminDuty]
        , playerVariables[playerid][pCrimes], playerVariables[playerid][pArrests]
        , playerVariables[playerid][pWarrants], playerVariables[playerid][pAge]
        , playerVariables[playerid][pVIPtokens], playerVariables[playerid][pRags]
        , playerVariables[playerid][pCarEngineStatua], playerVariables[playerid][fuel]);
I still get the same errors when I use this
Reply
#8

Add more "\" then:
pawn Code:
"%s, playerPhoneBook = '%d',\ playerGroup = '%d',\ playerGroupRank = '%d',\ playerIP = '%s', playerDropCarTimeout = '%d', \
        playerHotwireTime = '%d',\ playerRope = '%d',\ playerVehicleParts = '%d',\ playerScrewDriver = '%d',\ playerGasCan = '%d',\ playerSprayCan = '%d', \
        playerToolKit= '%d',\ playerIdentification = '%d',\ playerAdminDuty = '%d', \playerCrimes = '%d',\ playerArrests = '%d',\ playerWarrants = '%d',\ playerAge = '%d', \
        playerVIPtokens = '%d',\ playerRags = '%d',\ playerCarEngineStatus = '%d',\ playerFuel = '%d'"
Hope this might work.
Reply
#9

Quote:
Originally Posted by [HiC]TheKiller
View Post
You're going to have to use multiple formats so that it does not exceed the max line length.

pawn Code:
new saveQuery2[200];
        format(saveQuery, sizeof(saveQuery), "%s, playerPhoneBook = '%d', playerGroup = '%d', playerGroupRank = '%d', playerIP = '%s', playerDropCarTimeout = '%d', playerHotwireTime = '%d', playerRope = '%d', playerVehicleParts = '%d', playerScrewDriver = '%d', playerGasCan = '%d', playerSprayCan = '%d', playerToolKit= '%d'"
        , saveQuery, playerVariables[playerid][pPhoneBook], playerVariables[playerid][pGroup]
        , playerVariables[playerid][pGroupRank], playerVariables[playerid][pConnectionIP]
        , playerVariables[playerid][pDropCarTimeout], playerVariables[playerid][pHotwireTime]
        , playerVariables[playerid][pRope], playerVariables[playerid][pVehicleParts]
        , playerVariables[playerid][pScrewDriver], playerVariables[playerid][pGasCan]
        , playerVariables[playerid][pSprayCan], playerVariables[playerid][pToolKit]);


        format(saveQuery, sizeof(saveQuery), "%s, playerIdentification = '%d',playerAdminDuty = '%d', playerCrimes = '%d', playerArrests = '%d', playerWarrants = '%d', playerAge = '%d', playerVIPtokens = '%d',  playerRags = '%d', playerCarEngineStatus = '%d', playerFuel = '%d'"
        , saveQuery
        , playerVariables[playerid][pIdentification], playerVariables[playerid][pAdminDuty]
        , playerVariables[playerid][pCrimes], playerVariables[playerid][pArrests]
        , playerVariables[playerid][pWarrants], playerVariables[playerid][pAge]
        , playerVariables[playerid][pVIPtokens], playerVariables[playerid][pRags]
        , playerVariables[playerid][pCarEngineStatua], playerVariables[playerid][fuel]);
Thanks man this work for me
Reply
#10

It sometimes happens, when the line is extremely long. I remember I made a register part with SQL and even if I used "\", it gave errors, but it's rarely.
Then, use strcat, because format into format is slow.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)