Error SQL.
#1

Hello!

I have this error:
error 037: invalid string (possibly non-terminated string)
error 017: undefined symbol "UPDATE"
error 017: undefined symbol "srp_players_stats"
fatal error 107: too many error messages on one line

Here:

pawn Код:
format(query, sizeof(query), "UPDATE srp_players_stats SET PlayerLevel=%d, AdminLevel=%d, StatusRp=%d, Registered=%d, Sex=%d, Origin=%d, Money=%d, Bank=%d, Phonebook=%d, SuspendedTime=%d, Job=%d, Jailed=%d, JailTime=%d, Drugs=%d, Member=%d, Rank=%d, Chara=%d, pHealth=%f, Inte=%d, Model=%d, PhoneNr=%d, House=%d, House2=%d, House3=%d, Spawn=%d, Car=%d, Pos_x=%f, Pos_y=%f, Pos_z=%f, CarLic=%d, FlyLic=%d, BoatLic=%d, GunLic=%d, Gun1=%d, Gun2=%d, Gun3=%d, Gun4=%d, Ammo1=%d, Ammo2=%d, Ammo3=%d, Ammo4=%d, CarTime=%d, PayDay=%d, Tutorial=%d, Married=%d, MarriedTo='%s', Locked=%d, Matos=%d, IsAtHotel=%d, RpNoteRp=%d, PlayedTime=%d, PlayedTimeAll=%d, JobTime=%d, Car2=%d, Car3=%d, LicencePoint=%d, RankAdvancement=%d, Roop=%d, Baillon=%d, Jerrican=%d, Confiserie=%d, Cigarettes=%d, Feuilles=%d, Tabac=%d, Connected=%d, CarKeyOffer=%d, OfferTime=%d, Wanted=%d, Ip='%s', Email='%s', De=%d WHERE id=%d",
Can you help me?
Reply
#2

Try this
Код:
format(query, sizeof(query), "UPDATE `srp_players_stats` SET PlayerLevel=%d, AdminLevel=%d, StatusRp=%d, Registered=%d, Sex=%d, Origin=%d, Money=%d, Bank=%d, Phonebook=%d, SuspendedTime=%d, Job=%d, Jailed=%d, JailTime=%d, Drugs=%d, Member=%d, Rank=%d, Chara=%d, pHealth=%f, Inte=%d, Model=%d, PhoneNr=%d, House=%d, House2=%d, House3=%d, Spawn=%d, Car=%d, Pos_x=%f, Pos_y=%f, Pos_z=%f, CarLic=%d, FlyLic=%d, BoatLic=%d, GunLic=%d, Gun1=%d, Gun2=%d, Gun3=%d, Gun4=%d, Ammo1=%d, Ammo2=%d, Ammo3=%d, Ammo4=%d, CarTime=%d, PayDay=%d, Tutorial=%d, Married=%d, MarriedTo='%s', Locked=%d, Matos=%d, IsAtHotel=%d, RpNoteRp=%d, PlayedTime=%d, PlayedTimeAll=%d, JobTime=%d, Car2=%d, Car3=%d, LicencePoint=%d, RankAdvancement=%d, Roop=%d, Baillon=%d, Jerrican=%d, Confiserie=%d, Cigarettes=%d, Feuilles=%d, Tabac=%d, Connected=%d, CarKeyOffer=%d, OfferTime=%d, Wanted=%d, Ip='%s', Email='%s', De=%d WHERE id=%d",
WOrking now? Any warning/error reduced? post compile errors after trying this.
BTW what's the mysql version you are using?
Reply
#3

With your code:
error 037: invalid string (possibly non-terminated string)
error 017: undefined symbol "UPDATE"
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

I have:
new query[1024];

And in a_mysql.inc in header:
/*
SA-MP MySQL plugin R5
Copyright © 2008-2010, G-sTyLeZzZ
*/
Reply
#4

You get this at compiling your script right? Then it isn't a SQL error.
So try to remove half of the string and compile again, still get the error?
Reply
#5

Infact basic query was divided into 4-5 and I met in one to make it better optimized ..
Reply
#6

Yes but pawn cannot handle long lines, so you should divide it again.
Reply
#7

i think i removed 1 error lol...

ok now change the max value of string..

new query[2048];

instead of 1024 .. have you tried it?
Reply
#8

Quote:
Originally Posted by ShivRp
Посмотреть сообщение
i think i removed 1 error lol...

ok now change the max value of string..

new query[2048];

instead of 1024 .. have you tried it?
Doesn't matter, if the stringsize is to short it will not cause a compile error in this case as far as I know, it will cause a error when the query get executed.
Reply
#9

Quote:
Originally Posted by ShivRp
Посмотреть сообщение
i think i removed 1 error lol...

ok now change the max value of string..

new query[2048];

instead of 1024 .. have you tried it?
Yes but not work
Reply
#10

lines to long. zeex's compiler has a line limit increase so you can use that..or use strcat..(edit: hey it rhymed)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)