SA-MP Forums Archive
mysql save. - 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: mysql save. (/showthread.php?tid=305874)



mysql save. - budelis - 24.12.2011

Hi peoples. I don't know what happin here:

Код:
format(Query, sizeof(Query),"UPDATE `playerdata` SET `Pinigai` = '%d',`Banke` = '%d',`Patirtis` = '%d',`Admin` = '%d',`Vip` = '%d',`Darbas` = '%s',`Drabuziai` = '%d',`Uniforma` = '%d',`Direktorius` = '%s',`Gaudomas` = '%d',`Kalejime` = '%d',`Kreditai` = '%d',`Nuzudymai` = '%d',`Mirtys` = '%d',
Why i get errors:

Код:
C:\Program Files\Samp serveriai\NAUJAUSIAS SAMP SERVERIS\gamemodes\freeroam.pwn(4680) : error 037: invalid string (possibly non-terminated string)
C:\Program Files\Samp serveriai\NAUJAUSIAS SAMP SERVERIS\gamemodes\freeroam.pwn(4680) : error 017: undefined symbol "UPDATE"
C:\Program Files\Samp serveriai\NAUJAUSIAS SAMP SERVERIS\gamemodes\freeroam.pwn(4680) : error 029: invalid expression, assumed zero
C:\Program Files\Samp serveriai\NAUJAUSIAS SAMP SERVERIS\gamemodes\freeroam.pwn(4680) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.



Re: mysql save. - Jeffry - 24.12.2011

Forgot a " at the end?

pawn Код:
format(Query, sizeof(Query),"UPDATE `playerdata` SET `Pinigai` = '%d',`Banke` = '%d',`Patirtis` = '%d',`Admin` = '%d',`Vip` = '%d',`Darbas` = '%s',`Drabuziai` = '%d',`Uniforma` = '%d',`Direktorius` = '%s',`Gaudomas` = '%d',`Kalejime` = '%d',`Kreditai` = '%d',`Nuzudymai` = '%d',`Mirtys` = '%d'",



Re: mysql save. - budelis - 24.12.2011

maybe,but one more: how to make new line? because i save a lot of things,and i get error,"line is too long".


Re: mysql save. - Joe_ - 24.12.2011

You have to use an escape character..

Normal:
pawn Код:
format(something, sizeof(something), "Something is HERE");
And split into two lines:
pawn Код:
format(something, sizeof(something), "Something is \
HERE"
);
That character will let you continue the string on a new line.


Re: mysql save. - budelis - 24.12.2011

Maybe can say what is bad here?

Код:
format(Query,sizeof(Query),"SELECT Pinigai,Banke,Patirtis,Admin,Vip,Darbas,Drabuziai,Uniforma,Direktorius,Gaudomas,Kalejime,Kreditai,Nuzudymai,Mirtys,zMasina,zMasina2,Remontas,Remontas2,X_pozicija,Y_pozicija,Z_pozicija,Interjeras,Pastatas,Namas,Banas,VipLaikas,VipLaikas2, \
PINkodas,Ginklas0,Soviniai0,Ginklas1,Soviniai1,Ginklas2,Soviniai2,Ginklas3,Soviniai3,Ginklas4,Soviniai4,Ginklas5,Soviniai5,Ginklas6,Soviniai6,Ginklas7,Soviniai7,Ginklas8,Soviniai8,Ginklas9,Soviniai9,Ginklas10,Soviniai10,Ginklas11,Soviniai11 FROM playerdata WHERE Vardas = '%s'", PlayerName(playerid));
I get error line is too long...