SA-MP Forums Archive
Line too long - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Line too long (/showthread.php?tid=72528)



Line too long - watchout - 09.04.2009

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);



Re: Line too long - [M2S]moe - 09.04.2009

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


Re: Line too long - watchout - 09.04.2009

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?


Re: Line too long - watchout - 09.04.2009

Any ideas?


Re: Line too long - [M2S]moe - 09.04.2009

learn how to format strings. The wiki is your friend.


Re: Line too long - gijsmin - 09.04.2009

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


Re: Line too long - yezizhu - 09.04.2009

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);



Re: Line too long - [M2S]moe - 09.04.2009

lol! almost worth making a sig out of that.


Re: Line too long - _TeRmiNaToR_ - 09.04.2009

lol, This is the longest line.


Re: Line too long - Weirdosport - 09.04.2009

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.