SQL Error samp [+3 rep]
#1

Hi,
I have a problem I made this request to update my stats days but it make me an error
Код:
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(250) : warning 235: public function lacks forward declaration (symbol "Compte_Sauvegarde")
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(260) : error 075: input line too long (after substitutions)
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(261) : error 037: invalid string (possibly non-terminated string)
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(261) : error 017: undefined symbol "UPDATE"
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(261) : error 017: undefined symbol "lsr_comptes"
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(261) : fatal error 107: too many error messages on one line
Код:
public Compte_Sauvegarde(playerid)
{
   if(Login[playerid] == 0)
   {
	   return 1;
   }
   format(SQL_STRING, sizeof(SQL_STRING), "UPDATE lsr_comptes SET \
   Email='%s',Niveau=%d,Respect=%d,Respect=%d,RespectP=%d,Argent=%d,Banque=%d,NombreConnexion=%d\
   AdminLevel=%d,VipLevel=%d,Faim=%d,Soif=%d,Urine=%d,Sale=%d,Skin=%d,Numero=%d,Credits=%d,\
   Minutes=%d,Heures=%d,Age=%d,JailTemps=%d,JailType=%d,JailRaison='%s',JailPar='%s'\
   Inscrit=%d,Combat=%d,Dance=%d,Origine=%d,Sexe=%d,Permis=%d,PermisPoint=%d,Carte=%d,LocationVehicule=%d\
   CrashX=%f,CrashY=%f,CrashZ=%f,CrashInterieur=%d,CrashVirtualWorld=%d,Faction=%d,Rang=%d\
   RangJob=%d,PayeJob=%d,Ban=%d,BanRaison='%s',BanPar='%s' WHERE Nom='%s'",Joueur_Info[playerid][Joueur_Email]
   ,Joueur_Info[playerid][Joueur_Niveau]
   ,Joueur_Info[playerid][Joueur_Respect]
   ,Joueur_Info[playerid][Joueur_RespectP]
   ,Joueur_Info[playerid][Joueur_Argent]
   ,Joueur_Info[playerid][Joueur_Banque]
   ,Joueur_Info[playerid][Joueur_NombreConnexion]
   ,Joueur_Info[playerid][Joueur_AdminLevel]
   ,Joueur_Info[playerid][Joueur_VipLevel]
   ,Joueur_Info[playerid][Joueur_Faim]
   ,Joueur_Info[playerid][Joueur_Soif]
   ,Joueur_Info[playerid][Joueur_Urine]
   ,Joueur_Info[playerid][Joueur_Sale]
   ,Joueur_Info[playerid][Joueur_Skin]
   ,Joueur_Info[playerid][Joueur_Numero]
   ,Joueur_Info[playerid][Joueur_Credits]
   ,Joueur_Info[playerid][Joueur_Minutes]
   ,Joueur_Info[playerid][Joueur_Heures]
   ,Joueur_Info[playerid][Joueur_Age]
   ,Joueur_Info[playerid][Joueur_JailTemps]
   ,Joueur_Info[playerid][Joueur_JailType]
   ,Joueur_Info[playerid][Joueur_JailRaison]
   ,Joueur_Info[playerid][Joueur_JailPar]
   ,Joueur_Info[playerid][Joueur_Inscrit]
   ,Joueur_Info[playerid][Joueur_Combat]
   ,Joueur_Info[playerid][Joueur_Dance]
   ,Joueur_Info[playerid][Joueur_Origine]
   ,Joueur_Info[playerid][Joueur_Sexe]
   ,Joueur_Info[playerid][Joueur_Permis]
   ,Joueur_Info[playerid][Joueur_PermisPoint]
   ,Joueur_Info[playerid][Joueur_Carte]
   ,Joueur_Info[playerid][Joueur_LocationVehicule]
   ,Joueur_Info[playerid][Joueur_CrashX]
   ,Joueur_Info[playerid][Joueur_CrashY]
   ,Joueur_Info[playerid][Joueur_CrashZ]
   ,Joueur_Info[playerid][Joueur_CrashInterieur]
   ,Joueur_Info[playerid][Joueur_CrashVirtualWorld]
   ,Joueur_Info[playerid][Joueur_Faction]
   ,Joueur_Info[playerid][Joueur_Rang]
   ,Joueur_Info[playerid][Joueur_Job]
   ,Joueur_Info[playerid][Joueur_RangJob]
   ,Joueur_Info[playerid][Joueur_PayeJob]
   ,Joueur_Info[playerid][Joueur_Ban]
   ,Joueur_Info[playerid][Joueur_BanRaison]
   ,Joueur_Info[playerid][Joueur_BanPar]);
   mysql_query(SQL_STRING);
   return 1;
}
Reply
#2

Update values only when they need to be updated. There is no point in re-saving values that haven't changed. Ban information should be moved to a separate table entirely.
Reply
#3

pawn Код:
warning 235: public function lacks forward declaration (symbol "Compte_Sauvegarde")
It needs to be forwarded before using it:
pawn Код:
forward Compte_Sauvegarde(playerid);
If you do not call Compte_Sauvegarde by a timer or CallLocalFunction/CallRemoteFunction, then just use stock instead of public.
pawn Код:
stock Compte_Sauvegarde(playerid)
As for the rest, the line is too long; therebefore you will need to split it up. You also forgot the name in the arguments and few commas:
pawn Код:
new
    sz_Name[ MAX_PLAYER_NAME ]
;
GetPlayerName( playerid, sz_Name, MAX_PLAYER_NAME );

format(SQL_STRING, sizeof(SQL_STRING), "UPDATE lsr_comptes SET Email='%s',Niveau=%d,Respect=%d,Respect=%d,RespectP=%d,Argent=%d,Banque=%d,NombreConnexion=%d,AdminLevel=%d,VipLevel=%d,",
    Joueur_Info[playerid][Joueur_Email],Joueur_Info[playerid][Joueur_Niveau],Joueur_Info[playerid][Joueur_Respect],Joueur_Info[playerid][Joueur_RespectP],Joueur_Info[playerid][Joueur_Argent],
    Joueur_Info[playerid][Joueur_Banque],Joueur_Info[playerid][Joueur_NombreConnexion],Joueur_Info[playerid][Joueur_AdminLevel],Joueur_Info[playerid][Joueur_VipLevel]);

format(SQL_STRING, sizeof(SQL_STRING), "%sFaim=%d,Soif=%d,Urine=%d,Sale=%d,Skin=%d,Numero=%d,Credits=%d,Minutes=%d,Heures=%d,Age=%d,JailTemps=%d,JailType=%d,JailRaison='%s',JailPar='%s',",
    SQL_STRING,Joueur_Info[playerid][Joueur_Faim],Joueur_Info[playerid][Joueur_Soif],Joueur_Info[playerid][Joueur_Urine],Joueur_Info[playerid][Joueur_Sale],Joueur_Info[playerid][Joueur_Skin],
    Joueur_Info[playerid][Joueur_Numero],Joueur_Info[playerid][Joueur_Credits],Joueur_Info[playerid][Joueur_Minutes],Joueur_Info[playerid][Joueur_Heures],Joueur_Info[playerid][Joueur_Age],
    Joueur_Info[playerid][Joueur_JailTemps],Joueur_Info[playerid][Joueur_JailType],Joueur_Info[playerid][Joueur_JailRaison],Joueur_Info[playerid][Joueur_JailPar]);

format(SQL_STRING, sizeof(SQL_STRING), "%sInscrit=%d,Combat=%d,Dance=%d,Origine=%d,Sexe=%d,Permis=%d,PermisPoint=%d,Carte=%d,LocationVehicule=%d,CrashX=%f,CrashY=%f,CrashZ=%f,CrashInterieur=%d,",
    SQL_STRING,,Joueur_Info[playerid][Joueur_Inscrit],Joueur_Info[playerid][Joueur_Combat],Joueur_Info[playerid][Joueur_Dance],Joueur_Info[playerid][Joueur_Origine],Joueur_Info[playerid][Joueur_Sexe],
    Joueur_Info[playerid][Joueur_Permis],Joueur_Info[playerid][Joueur_PermisPoint],Joueur_Info[playerid][Joueur_Carte],Joueur_Info[playerid][Joueur_LocationVehicule],Joueur_Info[playerid][Joueur_CrashX],
    Joueur_Info[playerid][Joueur_CrashY],Joueur_Info[playerid][Joueur_CrashZ],Joueur_Info[playerid][Joueur_CrashInterieur]);

format(SQL_STRING, sizeof(SQL_STRING), "%sCrashVirtualWorld=%d,Faction=%d,Rang=%d,RangJob=%d,PayeJob=%d,Ban=%d,BanRaison='%s',BanPar='%s' WHERE Nom='%s'",SQL_STRING,
    Joueur_Info[playerid][Joueur_CrashVirtualWorld],Joueur_Info[playerid][Joueur_Faction],Joueur_Info[playerid][Joueur_Rang],Joueur_Info[playerid][Joueur_Job],
    Joueur_Info[playerid][Joueur_RangJob],Joueur_Info[playerid][Joueur_PayeJob],Joueur_Info[playerid][Joueur_Ban],Joueur_Info[playerid][Joueur_BanRaison],Joueur_Info[playerid][Joueur_BanPar], sz_Name);
Last, make sure that SQL_STRING is enough to store the whole Query.
Reply
#4

C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(250) : warning 235: public function lacks forward declaration (symbol "Compte_Sauvegarde")
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(257) : warning 217: loose indentation
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(259) : warning 217: loose indentation
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(268 -- 269) : error 029: invalid expression, assumed zero
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(269) : warning 217: loose indentation
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(269) : warning 215: expression has no effect
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(269) : warning 215: expression has no effect
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(269) : warning 215: expression has no effect
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(269) : warning 215: expression has no effect
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(269) : warning 215: expression has no effect
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(269 -- 270) : warning 215: expression has no effect
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(269 -- 270) : warning 215: expression has no effect
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(269 -- 270) : warning 215: expression has no effect
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(269 -- 270) : warning 215: expression has no effect
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(269 -- 270) : warning 215: expression has no effect
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(269 -- 271) : warning 215: expression has no effect
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(269 -- 271) : warning 215: expression has no effect
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(269 -- 271) : warning 215: expression has no effect
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(271) : error 001: expected token: ";", but found ")"
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(271) : error 029: invalid expression, assumed zero
C:\Users\Miguel\Documents\Gta San Andreas\Gta San Andreas\Pawn\Los Santos Reloaded v2$\gamemodes\LSRV2.pwn(271) : fatal error 107: too many error messages on one line

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

The code is a bit unreadable and it's hard to check it. I could only spot a part I used ",," by accident. You need to post the lines that gave the warnings.

pawn Код:
new
    sz_Name[ MAX_PLAYER_NAME ]
;
GetPlayerName( playerid, sz_Name, MAX_PLAYER_NAME );

format(SQL_STRING, sizeof(SQL_STRING), "UPDATE lsr_comptes SET Email='%s',Niveau=%d,Respect=%d,Respect=%d,RespectP=%d,Argent=%d,Banque=%d,NombreConnexion=%d,AdminLevel=%d,VipLevel=%d,",
Joueur_Info[playerid][Joueur_Email],Joueur_Info[playerid][Joueur_Niveau],Joueur_Info[playerid][Joueur_Respect],Joueur_Info[playerid][Joueur_RespectP],Joueur_Info[playerid][Joueur_Argent],
Joueur_Info[playerid][Joueur_Banque],Joueur_Info[playerid][Joueur_NombreConnexion],Joueur_Info[playerid][Joueur_AdminLevel],Joueur_Info[playerid][Joueur_VipLevel]);

format(SQL_STRING, sizeof(SQL_STRING), "%sFaim=%d,Soif=%d,Urine=%d,Sale=%d,Skin=%d,Numero=%d,Credits=%d,Minutes=%d,Heures=%d,Age=%d,JailTemps=%d,JailType=%d,JailRaison='%s',JailPar='%s',",
SQL_STRING,Joueur_Info[playerid][Joueur_Faim],Joueur_Info[playerid][Joueur_Soif],Joueur_Info[playerid][Joueur_Urine],Joueur_Info[playerid][Joueur_Sale],Joueur_Info[playerid][Joueur_Skin],
Joueur_Info[playerid][Joueur_Numero],Joueur_Info[playerid][Joueur_Credits],Joueur_Info[playerid][Joueur_Minutes],Joueur_Info[playerid][Joueur_Heures],Joueur_Info[playerid][Joueur_Age],
Joueur_Info[playerid][Joueur_JailTemps],Joueur_Info[playerid][Joueur_JailType],Joueur_Info[playerid][Joueur_JailRaison],Joueur_Info[playerid][Joueur_JailPar]);

format(SQL_STRING, sizeof(SQL_STRING), "%sInscrit=%d,Combat=%d,Dance=%d,Origine=%d,Sexe=%d,Permis=%d,PermisPoint=%d,Carte=%d,LocationVehicule=%d,CrashX=%f,CrashY=%f,CrashZ=%f,CrashInterieur=%d,",
SQL_STRING,Joueur_Info[playerid][Joueur_Inscrit],Joueur_Info[playerid][Joueur_Combat],Joueur_Info[playerid][Joueur_Dance],Joueur_Info[playerid][Joueur_Origine],Joueur_Info[playerid][Joueur_Sexe],
Joueur_Info[playerid][Joueur_Permis],Joueur_Info[playerid][Joueur_PermisPoint],Joueur_Info[playerid][Joueur_Carte],Joueur_Info[playerid][Joueur_LocationVehicule],Joueur_Info[playerid][Joueur_CrashX],
Joueur_Info[playerid][Joueur_CrashY],Joueur_Info[playerid][Joueur_CrashZ],Joueur_Info[playerid][Joueur_CrashInterieur]);

format(SQL_STRING, sizeof(SQL_STRING), "%sCrashVirtualWorld=%d,Faction=%d,Rang=%d,RangJob=%d,PayeJob=%d,Ban=%d,BanRaison='%s',BanPar='%s' WHERE Nom='%s'",SQL_STRING,
Joueur_Info[playerid][Joueur_CrashVirtualWorld],Joueur_Info[playerid][Joueur_Faction],Joueur_Info[playerid][Joueur_Rang],Joueur_Info[playerid][Joueur_Job],
Joueur_Info[playerid][Joueur_RangJob],Joueur_Info[playerid][Joueur_PayeJob],Joueur_Info[playerid][Joueur_Ban],Joueur_Info[playerid][Joueur_BanRaison],Joueur_Info[playerid][Joueur_BanPar], sz_Name);
Reply
#6

Thank You +3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)