SA-MP Forums Archive
Error SQL. - 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)
+--- Thread: Error SQL. (/showthread.php?tid=510035)



Error SQL. - TheSy - 29.04.2014

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?


Re: Error SQL. - Guest4390857394857 - 29.04.2014

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?


Re : Error SQL. - TheSy - 29.04.2014

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
*/


Re: Error SQL. - Roel - 29.04.2014

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?


Re : Error SQL. - TheSy - 29.04.2014

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


Re: Error SQL. - Roel - 29.04.2014

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


Re: Error SQL. - Guest4390857394857 - 29.04.2014

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?


Re: Error SQL. - Roel - 29.04.2014

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.


Re : Re: Error SQL. - TheSy - 29.04.2014

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


Re: Error SQL. - Ada32 - 29.04.2014

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