syntax error
#1

Hello,

When i'm register on my server i have this problem in mysql_log,

Код HTML:
[14:50:08] [ERROR] CMySQLQuery::Execute[] - (error #1064) 
Syntax error near '`Arme6' line 1
And i'm disconnecte of my server i have this probleme in mysq_log

Код HTML:
[14:51:17] [ERROR] CMySQLQuery::Execute[] - (error #1064) 
Syntax error near ''0' line 1
And my code of this server is disconnecte this server

Код HTML:
SQL_SaveCharacter(playerid)
{

	if (pInfo[playerid][pLogged] == 0)
    {
        return 0;
    }

	new
	    query[1048];


	printf("compte enregistrer");
	pInfo[playerid][Skin] = GetPlayerSkin(playerid);
	GetPlayerHealth(playerid, pInfo[playerid][Health]);
	GetPlayerArmour(playerid, pInfo[playerid][Armour]);
	format(query, sizeof(query), "UPDATE `accounts` SET `Enregistrer` = '%d', `Admin` = '%d', `Level` = '%d', `Exp` = '%d', `MaxExp` = '%d', `Skin` = '%d', `Sexe` = '%d', `Vie` = '%d', `Gillet` = '%d', `Cash` = '%d', `BanqueCash` = '%d', `Masque` = '%d', `MasqueID` = '%d', `NumeroTel` = '%d', `Maison` = '%d', `Commerce` = '%d', `FactionProprio` = '%d', `Vehicule1` = '%d', `Vehicule2` = '%d', `Vehicule3` = '%d', `Faction` = '%d', `Grade` = '%d'",
		pInfo[playerid][Registered],
		pInfo[playerid][Admin],
		pInfo[playerid][Level],
		pInfo[playerid][Exp],
		pInfo[playerid][MaxExp],
		pInfo[playerid][Skin],
		pInfo[playerid][Gender],
		pInfo[playerid][Health],
		pInfo[playerid][Armour],
		pInfo[playerid][HandMoney],
		pInfo[playerid][BankMoney],
		pInfo[playerid][Mask],
		pInfo[playerid][MaskID],
		pInfo[playerid][PhoneNumber],
		pInfo[playerid][HouseOwner],
		pInfo[playerid][BizOwner],
		pInfo[playerid][FacOwner],
  		pInfo[playerid][VehicleOwner],
  		pInfo[playerid][VehicleOwner2],
  		pInfo[playerid][VehicleOwner3],
  		pInfo[playerid][SecteID],
  		pInfo[playerid][Grade]
	);
	format(query, sizeof(query), "%s, `ChequeJob` = '%d', `TempsTravail` = '%d', `Montre` = '%d', `GPS` = '%d', `Canne` = '%d', `Telephone` = '%d', `Credits` = '%d', `Identite` = '%d', `GramDrogue1` = '%d', `GramDrogue2` = '%d', `GramDrogue3` = '%d', `Cocaine` = '%d', `Heroine` = '%d', `Ecstacy` = '%d', `Mort` = '%d', `JailTemps` = '%d', `Amende` = '%d', `Facture` = '%d', `Emprunt` = '%d', `Lotto` = '%d', `Warn` = '%d'",
		query,
		pInfo[playerid][PayeCheck],
		pInfo[playerid][PayeTime],
		pInfo[playerid][Montre],
		pInfo[playerid][Gps],
		pInfo[playerid][Canne],
		pInfo[playerid][Phone],
		pInfo[playerid][Credits],
		pInfo[playerid][CarteIden],
		pInfo[playerid][DrogueFab1],
		pInfo[playerid][DrogueFab2],
		pInfo[playerid][DrogueFab3],
		pInfo[playerid][Cocaine],
		pInfo[playerid][Heroine],
		pInfo[playerid][Ecstacy],
		pInfo[playerid][Mort],
		pInfo[playerid][JailTime],
		pInfo[playerid][Amende],
		pInfo[playerid][Facture],
		pInfo[playerid][Emprunt],
		pInfo[playerid][Lotto],
		pInfo[playerid][Warn]

	);
	format(query, sizeof(query), "%s, `Bannis` = '%d', `Permis` = '%d', `PointPermis` = '%d', `PortArme` = '%d', `Situation` = '%d', `Arme1` = '%d', `Minution1` = '%d', `Arme2` = '%d', `Minution2` = '%d', `Arme3` = '%d', `Minution3` = '%d', `Arme4` = '%d', `Minution4` = '%d', `Arme5` = '%d', `Minution5` = '%d', `Arme6` = '%d', `Minution6` = '%d', `Arme7` = '%d', `Minution7` = '%d' WHERE `ID` = '%d'",
	    query,
	    pInfo[playerid][Baned],
	    pInfo[playerid][Permis],
	    pInfo[playerid][PermisPoint],
	    pInfo[playerid][PortArme],
	    pInfo[playerid][LastPos],
	    pInfo[playerid][Weapon1],
	    pInfo[playerid][Wep1Ammo],
	    pInfo[playerid][Weapon2],
	    pInfo[playerid][Wep2Ammo],
	    pInfo[playerid][Weapon3],
	    pInfo[playerid][Wep3Ammo],
	    pInfo[playerid][Weapon4],
	    pInfo[playerid][Wep4Ammo],
	    pInfo[playerid][Weapon5],
	    pInfo[playerid][Wep5Ammo],
	    pInfo[playerid][Weapon6],
	    pInfo[playerid][Wep6Ammo],
	    pInfo[playerid][Weapon7],
	    pInfo[playerid][Wep7Ammo],
		pInfo[playerid][ID]
	);
	mysql_tquery(g_iHandle, query);
	return 1;
}
Reply
#2

These lines are wrong.
PHP код:
format(querysizeof(query), "UPDATE `accounts` SET `Enregistrer` = '%d', `Admin` = '%d', `Level` = '%d', `Exp` = '%d', `MaxExp` = '%d', `Skin` = '%d', `Sexe` = '%d', `Vie` = '%d', `Gillet` = '%d', `Cash` = '%d', `BanqueCash` = '%d', `Masque` = '%d', `MasqueID` = '%d', `NumeroTel` = '%d', `Maison` = '%d', `Commerce` = '%d', `FactionProprio` = '%d', `Vehicule1` = '%d', `Vehicule2` = '%d', `Vehicule3` = '%d', `Faction` = '%d', `Grade` = '%d'",
//...
format(querysizeof(query), "%s, `Bannis` = '%d', `Permis` = '%d', `PointPermis` = '%d', `PortArme` = '%d', `Situation` = '%d', `Arme1` = '%d', `Minution1` = '%d', `Arme2` = '%d', `Minution2` = '%d', `Arme3` = '%d', `Minution3` = '%d', `Arme4` = '%d', `Minution4` = '%d', `Arme5` = '%d', `Minution5` = '%d', `Arme6` = '%d', `Minution6` = '%d', `Arme7` = '%d', `Minution7` = '%d' WHERE `ID` = '%d'"
Remove the '' from the %d

Eg.
PHP код:
format(querysizeof(query), "UPDATE `accounts` SET `Enregistrer` = %d, `Admin` = %d, `Level` = %d,//Continue... 
Reply
#3

I have changed the code

Код HTML:
SQL_SaveCharacter(playerid)
{

	if (pInfo[playerid][pLogged] == 0)
    {
        return 0;
    }

	new
	    query[1048];


	printf("compte enregistrer");
	pInfo[playerid][Skin] = GetPlayerSkin(playerid);
	GetPlayerHealth(playerid, pInfo[playerid][Health]);
	GetPlayerArmour(playerid, pInfo[playerid][Armour]);
	format(query, sizeof(query), "UPDATE `accounts` SET `Enregistrer` = '%d', `Admin` = '%d', `Level` = '%d', `Exp` = '%d', `MaxExp` = '%d', `Skin` = '%d', `Sexe` = '%d', `Vie` = '%d', `Gillet` = '%d', `Cash` = '%d', `BanqueCash` = '%d', `Masque` = '%d', `MasqueID` = '%d', `NumeroTel` = '%d', `Maison` = '%d', `Commerce` = '%d', `FactionProprio` = '%d', `Vehicule1` = '%d', `Vehicule2` = '%d', `Vehicule3` = '%d', `Faction` = '%d', `Grade` = '%d' WHERE `ID` = '%d'",
		pInfo[playerid][Registered],
		pInfo[playerid][Admin],
		pInfo[playerid][Level],
		pInfo[playerid][Exp],
		pInfo[playerid][MaxExp],
		pInfo[playerid][Skin],
		pInfo[playerid][Gender],
		pInfo[playerid][Health],
		pInfo[playerid][Armour],
		pInfo[playerid][HandMoney],
		pInfo[playerid][BankMoney],
		pInfo[playerid][Mask],
		pInfo[playerid][MaskID],
		pInfo[playerid][PhoneNumber],
		pInfo[playerid][HouseOwner],
		pInfo[playerid][BizOwner],
		pInfo[playerid][FacOwner],
  		pInfo[playerid][VehicleOwner],
  		pInfo[playerid][VehicleOwner2],
  		pInfo[playerid][VehicleOwner3],
  		pInfo[playerid][SecteID],
  		pInfo[playerid][Grade]
	);
	format(query, sizeof(query), "UPDATE `accounts` SET `ChequeJob` = '%d', `TempsTravail` = '%d', `Montre` = '%d', `GPS` = '%d', `Canne` = '%d', `Telephone` = '%d', `Credits` = '%d', `Identite` = '%d', `GramDrogue1` = '%d', `GramDrogue2` = '%d', `GramDrogue3` = '%d', `Cocaine` = '%d', `Heroine` = '%d', `Ecstacy` = '%d', `Mort` = '%d', `JailTemps` = '%d', `Amende` = '%d', `Facture` = '%d', `Emprunt` = '%d', `Lotto` = '%d', `Warn` = '%d' WHERE `ID` = '%d'",
		query,
		pInfo[playerid][PayeCheck],
		pInfo[playerid][PayeTime],
		pInfo[playerid][Montre],
		pInfo[playerid][Gps],
		pInfo[playerid][Canne],
		pInfo[playerid][Phone],
		pInfo[playerid][Credits],
		pInfo[playerid][CarteIden],
		pInfo[playerid][DrogueFab1],
		pInfo[playerid][DrogueFab2],
		pInfo[playerid][DrogueFab3],
		pInfo[playerid][Cocaine],
		pInfo[playerid][Heroine],
		pInfo[playerid][Ecstacy],
		pInfo[playerid][Mort],
		pInfo[playerid][JailTime],
		pInfo[playerid][Amende],
		pInfo[playerid][Facture],
		pInfo[playerid][Emprunt],
		pInfo[playerid][Lotto],
		pInfo[playerid][Warn]

	);
	format(query, sizeof(query), "UPDATE `accounts` SET `Bannis` = '%d', `Permis` = '%d', `PointPermis` = '%d', `PortArme` = '%d', `Situation` = '%d', `Arme1` = '%d', `Minution1` = '%d', `Arme2` = '%d', `Minution2` = '%d', `Arme3` = '%d', `Minution3` = '%d', `Arme4` = '%d', `Minution4` = '%d', `Arme5` = '%d', `Minution5` = '%d', `Arme6` = '%d', `Minution6` = '%d', `Arme7` = '%d', `Minution7` = '%d' WHERE `ID` = '%d'",
	    query,
	    pInfo[playerid][Baned],
	    pInfo[playerid][Permis],
	    pInfo[playerid][PermisPoint],
	    pInfo[playerid][PortArme],
	    pInfo[playerid][LastPos],
	    pInfo[playerid][Weapon1],
	    pInfo[playerid][Wep1Ammo],
	    pInfo[playerid][Weapon2],
	    pInfo[playerid][Wep2Ammo],
	    pInfo[playerid][Weapon3],
	    pInfo[playerid][Wep3Ammo],
	    pInfo[playerid][Weapon4],
	    pInfo[playerid][Wep4Ammo],
	    pInfo[playerid][Weapon5],
	    pInfo[playerid][Wep5Ammo],
	    pInfo[playerid][Weapon6],
	    pInfo[playerid][Wep6Ammo],
	    pInfo[playerid][Weapon7],
	    pInfo[playerid][Wep7Ammo],
		pInfo[playerid][ID]
	);
	mysql_tquery(g_iHandle, query);
	return 1;
}
no error in mysql_log


in the base data is all 0

So it does not save
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)