Line too long
#1

Hello, I am trying to insert to mysql player's accounts, but I get errors. Because there are too much columns and user informations in the line, I get this errors:

Code:
D:\DOKUME~1\Krip\Desktop\samp\GAMEMO~1\pwn.pwn(7265) : error 075: input line too long (after substitutions)
D:\DOKUME~1\Krip\Desktop\samp\GAMEMO~1\pwn.pwn(7266) : error 037: invalid string (possibly non-terminated string)
D:\DOKUME~1\Krip\Desktop\samp\GAMEMO~1\pwn.pwn(7266) : error 017: undefined symbol "INSERT"
D:\DOKUME~1\Krip\Desktop\samp\GAMEMO~1\pwn.pwn(7266) : error 017: undefined symbol "INTO"
D:\DOKUME~1\Krip\Desktop\samp\GAMEMO~1\pwn.pwn(7266) : fatal error 107: too many error messages on one line
Lines:

Code:
LINE 7265: new query[128];
LINE 7266: format(query, sizeof(query), "INSERT INTO players (Name, Password, Cash, Account, Admin, Level, Exp, Pupgrade, Kills, LJ, IJ, SR, WA, PEN, Gun1, Gun2, Gun3, Gun4, Gun5, Gun6, Ammo1, Ammo2, Ammo3, Ammo4, Ammo5, Ammo6, SHealth, Health, Pos_x, Pos_y, Pos_z, Int, Local, Team, Model, Pnumber, Phousekey, Pbiskey, Gang, Gleader, RealAdmin, TOS, Job, GLicense, DLicense, Resign, FLicense, CKey, Hotwire, Donation, CLicense, Strength, TLicense) VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s', '%s', '%s', '%s','%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')", playername2, PlayerInfox[playerid][pxPassword], PlayerInfox[playerid][pxCash],PlayerInfox[playerid][pxAccount],PlayerInfox[playerid][pxAdmin],PlayerInfox[playerid][pxLevel],PlayerInfox[playerid][pxExp],PlayerInfox[playerid][gxPupgrade],PlayerInfox[playerid][gxKills],PlayerInfox[playerid][gxLJ],PlayerInfox[playerid][gxIJ],PlayerInfox[playerid][gxSR],PlayerInfox[playerid][gxWA],PlayerInfox[playerid][gxPEN],PlayerInfox[playerid][gxGun1],PlayerInfox[playerid][gxGun2],PlayerInfox[playerid][gxGun3],PlayerInfox[playerid][gxGun4],PlayerInfox[playerid][gxGun5],PlayerInfox[playerid][gxGun6],PlayerInfox[playerid][gxAmmo1],PlayerInfox[playerid][gxAmmo2], PlayerInfox[playerid][gxAmmo3], PlayerInfox[playerid][gxAmmo4], PlayerInfox[playerid][gxAmmo5], PlayerInfox[playerid][gxAmmo6], PlayerInfox[playerid][gxSHealth], PlayerInfox[playerid][gxHealth],PlayerInfox[playerid][gxPos_x],PlayerInfox[playerid][gxPos_y],PlayerInfox[playerid][gxPos_z],PlayerInfox[playerid][gxInt],PlayerInfox[playerid][gxLocal],PlayerInfox[playerid][gxTeam], PlayerInfox[playerid][gxModel], PlayerInfox[playerid][gxPnumber], PlayerInfox[playerid][gxPhousekey], PlayerInfox[playerid][gxPbiskey], PlayerInfox[playerid][gxGang], PlayerInfox[playerid][gxGleader], PlayerInfox[playerid][gxRealadmin], PlayerInfox[playerid][gxTOS], PlayerInfox[playerid][gxJob], PlayerInfox[playerid][gxGLicense], PlayerInfox[playerid][gxDLicense], PlayerInfox[playerid][gxResign], PlayerInfox[playerid][gxFLicense], PlayerInfox[playerid][gxCKey], PlayerInfox[playerid][gxHotwire], PlayerInfox[playerid][gxDonation], PlayerInfox[playerid][gxCLicense], PlayerInfox[playerid][Strength], PlayerInfox[playerid][TLicense]);
samp_mysql_query(query);
Reply
#2

that wouldnt work anyway as you define intergers as strings etc, but start by making query[256] instead of 128.
Reply
#3

Quote:
Originally Posted by [M2S
moe ]
that wouldnt work anyway as you define intergers as strings etc, but start by making query[256] instead of 128.
Ok I made it 256. How should I fix it then?
Reply
#4

Any ideas?
Reply
#5

learn how to format strings. The wiki is your friend.
Reply
#6

Common you created a string with the max size of: 256
But you have the size: 709
so create that string with the size 1500
Reply
#7

Tey this
pawn Code:
new query[1024];
format(query, sizeof(query), "INSERT INTO players (Name, Password, Cash, Account, Admin, Level, Exp, Pupgrade, Kills, LJ, IJ, SR, WA, PEN, \
Gun1, Gun2, Gun3, Gun4, Gun5, Gun6, Ammo1, Ammo2, Ammo3, Ammo4, Ammo5, Ammo6, SHealth, Health, Pos_x, Pos_y, Pos_z, Int, Local, \
Team, Model, Pnumber, Phousekey, Pbiskey, Gang, Gleader, RealAdmin, TOS, Job, GLicense, DLicense, Resign, FLicense, CKey, Hotwire, Donation, CLicense, Strength, TLicense) \
VALUES ('%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s',\ '%s', '%s', '%s', '%s','%s','%s','%s','%s','%s','%s','%s','%s',\'%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s','%s', '%s', '%s', '%s',\
'%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s')"
, \
playername2, PlayerInfox[playerid][pxPassword], PlayerInfox[playerid][pxCash],PlayerInfox[playerid][pxAccount],PlayerInfox[playerid][pxAdmin],\
PlayerInfox[playerid][pxLevel],PlayerInfox[playerid][pxExp],PlayerInfox[playerid][gxPupgrade],PlayerInfox[playerid][gxKills],\
PlayerInfox[playerid][gxLJ],PlayerInfox[playerid][gxIJ],PlayerInfox[playerid][gxSR],PlayerInfox[playerid][gxWA],\
PlayerInfox[playerid][gxPEN],PlayerInfox[playerid][gxGun1],PlayerInfox[playerid][gxGun2],PlayerInfox[playerid][gxGun3],\
PlayerInfox[playerid][gxGun4],PlayerInfox[playerid][gxGun5],PlayerInfox[playerid][gxGun6],\
PlayerInfox[playerid][gxAmmo1],PlayerInfox[playerid][gxAmmo2], PlayerInfox[playerid][gxAmmo3], PlayerInfox[playerid][gxAmmo4], PlayerInfox[playerid][gxAmmo5], PlayerInfox[playerid][gxAmmo6], \
PlayerInfox[playerid][gxSHealth], PlayerInfox[playerid][gxHealth],\
PlayerInfox[playerid][gxPos_x],PlayerInfox[playerid][gxPos_y],PlayerInfox[playerid][gxPos_z],\
PlayerInfox[playerid][gxInt],PlayerInfox[playerid][gxLocal],PlayerInfox[playerid][gxTeam], PlayerInfox[playerid][gxModel], PlayerInfox[playerid][gxPnumber], \
PlayerInfox[playerid][gxPhousekey], PlayerInfox[playerid][gxPbiskey], PlayerInfox[playerid][gxGang], PlayerInfox[playerid][gxGleader], PlayerInfox[playerid][gxRealadmin], PlayerInfox[playerid][gxTOS], PlayerInfox[playerid][gxJob], PlayerInfox[playerid][gxGLicense], \
PlayerInfox[playerid][gxDLicense], PlayerInfox[playerid][gxResign], PlayerInfox[playerid][gxFLicense], PlayerInfox[playerid][gxCKey], PlayerInfox[playerid][gxHotwire], PlayerInfox[playerid][gxDonation], \
PlayerInfox[playerid][gxCLicense], PlayerInfox[playerid][Strength], PlayerInfox[playerid][TLicense]);
samp_mysql_query(query);
Reply
#8

lol! almost worth making a sig out of that.
Reply
#9

lol, This is the longest line.
Reply
#10

Why the crap would you ever need a string that long, break it up for gods sakes you're bound to get errors and they'll be near impossible to correct as it's so hard to look at.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)