SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 04/08/2016, 11:11 PM   #1
Sirop
Big Clucker
 
Sirop's Avatar
 
Join Date: Oct 2015
Posts: 91
Reputation: 2
Default No save

Hello it does not register

[00:26:38] [ERROR] CMySQLQuery::Execute[OnQueryFinished] - (error #1054) Champ 'compte' inconnu dans where clause

HTML Code:
SQL_CreationCompte(playerid)
{
	if (!pInfo[playerid][pLogged])
		return 0;

	new
	    query[512];

    format(query,  sizeof(query), "INSERT INTO `compte` (`ID` = %d, \
	`Enregistrer` = %d, \
    `Vie` = %d, \
    `Gillet` = %d, \
    `Masque` = %d, \
    `MasqueID` = %d, \
    `Faction` = '%d', \
    `Grade` = %d, \
    `Situation` = %d, \
    `Mort` = %d, \
    `TempsJail` = %d, \
    `Warn` = %d, \
    `Banned` = %d, \
    `Maison` = %d, \
    `Commerce` = %d, \
    `FactionProprietaire` = %d, \
    `Vehicule1` = %d, \
    `Vehicule2` = %d, \
    `Vehicule3` = %d, \
	`Level` = %d, \
    `Experience` = %d, \
    `MaxExperience` = %d, \
    `Skin` = %d, \
    `Sexe` = %d, \
    `Cash` = %d, \
    `CashBanque` = %d, \
    `NumeroTel` = %d, \
    `Cheque` = %d, \
    `Temps` = %d, \
    `Amende` = %d, \
    `Facture` = %d, \
    `Emprunt` = %d, \
    `Lotto` = %d, \
    `Permis` = %d, \
    `PermisPoint` = %d, \
    `PortArme` = %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, \
    `Arme1` = %d, \
    `Minition1` = %d, \
    `Arme2` = %d, \
    `Minition2` = %d, \
    `Arme3` = %d, \
    `Minition3` = %d, \
    `Arme4` = %d, \
    `Minition4` = %d, \
    `Arme5` = %d, \
    `Minition5` = %d, \
    `Arme6` = %d, \
    `Minition6` = %d, \
    `Arme7` = %d, \
    `Minition7` = %d \
    VALUES('%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
	pInfo[playerid][pID],
	pInfo[playerid][Registered],
	pInfo[playerid][Health],
	pInfo[playerid][Armour],
	pInfo[playerid][Mask],
	pInfo[playerid][MaskID],
	pInfo[playerid][SecteID],
	pInfo[playerid][Grade],
	pInfo[playerid][LastPos],
	pInfo[playerid][Mort],
	pInfo[playerid][JailTime],
	pInfo[playerid][Warn],
	pInfo[playerid][Baned],
	pInfo[playerid][HouseOwner],
	pInfo[playerid][BizOwner],
	pInfo[playerid][FacOwner],
	pInfo[playerid][VehicleOwner],
	pInfo[playerid][VehicleOwner2],
	pInfo[playerid][VehicleOwner3],
	pInfo[playerid][Level],
	pInfo[playerid][Exp],
	pInfo[playerid][MaxExp],
	pInfo[playerid][Skin],
	pInfo[playerid][Gender],
	pInfo[playerid][HandMoney],
	pInfo[playerid][BankMoney],
	pInfo[playerid][PhoneNumber],
	pInfo[playerid][PayeCheck],
	pInfo[playerid][PayeTime],
	pInfo[playerid][Amende],
	pInfo[playerid][Facture],
	pInfo[playerid][Emprunt],
	pInfo[playerid][Lotto],
	pInfo[playerid][Permis],
	pInfo[playerid][PermisPoint],
	pInfo[playerid][PortArme],
	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][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]
	);
	//mysql_tquery(g_iHandle, query);
	mysql_tquery(g_iHandle, query, "OnQueryFinished", "dd", playerid, THREAD_CREATE_CHAR);
	return 1;
}
Sirop is offline   Reply With Quote
Old 04/08/2016, 11:13 PM   #2
Fantje
Huge Clucker
 
Join Date: Dec 2014
Posts: 393
Reputation: 9
Default Re: No save

PHP Code:
Champ 'compte' inconnu dans where clause 
translate this please
__________________
Fantje is offline   Reply With Quote
Old 04/08/2016, 11:14 PM   #3
Stinged
High-roller
 
Join Date: Feb 2013
Posts: 1,571
Reputation: 187
Default Re: No save

That's not the correct INSERT syntax.
It's supposed to be:
PHP Code:
INSERT INTO `table_name` (`Field_1`, `Field_2`, `Field_3`) VALUES (Value_1Value_2Value_3

Last edited by Stinged; 05/08/2016 at 01:44 PM.
Stinged is offline   Reply With Quote
Old 04/08/2016, 11:19 PM   #4
AndySedeyn
High-roller
 
AndySedeyn's Avatar
 
Join Date: Feb 2014
Location: Belgium
Posts: 1,206
Reputation: 681
Default Re: No save

Quote:
Originally Posted by Fantje View Post
PHP Code:
Champ 'compte' inconnu dans where clause 
translate this please
"field 'compte' unknown in the where clause"

Konstantinos, I and now Stinged have told you that there's a problem with your syntax!

Konstantinos' reply: http://forum.sa-mp.com/showpost.php?...65&postcount=6
My reply: http://forum.sa-mp.com/showpost.php?...0&postcount=10
AndySedeyn is offline   Reply With Quote
Old 05/08/2016, 01:42 PM   #6
Sirop
Big Clucker
 
Sirop's Avatar
 
Join Date: Oct 2015
Posts: 91
Reputation: 2
Default Re: No save

I do not understand these tutorials though the syntax is good I do not understand
Sirop is offline   Reply With Quote
Old 05/08/2016, 01:44 PM   #7
Stinged
High-roller
 
Join Date: Feb 2013
Posts: 1,571
Reputation: 187
Default Re: No save

Quote:
Originally Posted by Sirop View Post
I do not understand these tutorials though the syntax is good I do not understand
How is the syntax good? Look again.

What you're doing (Short version):
Code:
INSERT INTO `compte` (`ID` = %d, `Enregistrer` = %d) VALUES (%d, %d)
What it's supposed to be:
Code:
INSERT INTO `compte` (`ID`, `Enregistrer`) VALUES (%d, %d)
Stinged is offline   Reply With Quote
Old 05/08/2016, 07:17 PM   #8
Sirop
Big Clucker
 
Sirop's Avatar
 
Join Date: Oct 2015
Posts: 91
Reputation: 2
Default Re: No save

It still does not work

HTML Code:
SQL_CreationCompte(playerid)
{
	if (!pInfo[playerid][pLogged])
		return 0;

    new
	    query[2048];
	    
    format(query,  sizeof(query), "INSERT INTO `compte` (`ID` \
	`Enregistrer` \
    `Vie` \
    `Gillet` \
    `Masque`  \
    `MasqueID` \
    `Faction` \
    `Grade` \
    `Situation` \
    `Mort` \
    `TempsJail` \
    `Warn` \
    `Banned` \
    `Maison` \
    `Commerce` \
    `FactionProprietaire` \
    `Vehicule1` \
    `Vehicule2` \
    `Vehicule3` \
	`Level` \
    `Experience` \
    `MaxExperience` \
    `Skin` \
    `Sexe` \
    `Cash` \
    `CashBanque` \
    `NumeroTel` \
    `Cheque` \
    `Temps` \
    `Amende` \
    `Facture` \
    `Emprunt` \
    `Lotto` \
    `Permis` \
    `PermisPoint` \
    `PortArme` \
    `Montre` \
    `GPS` \
    `Canne` \
    `Telephone` \
    `Credits` \
    `Identite` \
    `GramDrogue1` \
    `GramDrogue2` \
    `GramDrogue3` \
    `Cocaine` \
    `Heroine` \
    `Ecstacy` \
    `Arme1` \
    `Minition1` \
    `Arme2` \
    `Minition2` \
    `Arme3` \
    `Minition3` \
    `Arme4` \
    `Minition4` \
    `Arme5` \
    `Minition5` \
    `Arme6` \
    `Minition6` \
    `Arme7` \
    `Minition7` \
    VALUES('%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
	pInfo[playerid][pID],
	pInfo[playerid][Registered],
	pInfo[playerid][Health],
	pInfo[playerid][Armour],
	pInfo[playerid][Mask],
	pInfo[playerid][MaskID],
	pInfo[playerid][SecteID],
	pInfo[playerid][Grade],
	pInfo[playerid][LastPos],
	pInfo[playerid][Mort],
	pInfo[playerid][JailTime],
	pInfo[playerid][Warn],
	pInfo[playerid][Baned],
	pInfo[playerid][HouseOwner],
	pInfo[playerid][BizOwner],
	pInfo[playerid][FacOwner],
	pInfo[playerid][VehicleOwner],
	pInfo[playerid][VehicleOwner2],
	pInfo[playerid][VehicleOwner3],
	pInfo[playerid][Level],
	pInfo[playerid][Exp],
	pInfo[playerid][MaxExp],
	pInfo[playerid][Skin],
	pInfo[playerid][Gender],
	pInfo[playerid][HandMoney],
	pInfo[playerid][BankMoney],
	pInfo[playerid][PhoneNumber],
	pInfo[playerid][PayeCheck],
	pInfo[playerid][PayeTime],
	pInfo[playerid][Amende],
	pInfo[playerid][Facture],
	pInfo[playerid][Emprunt],
	pInfo[playerid][Lotto],
	pInfo[playerid][Permis],
	pInfo[playerid][PermisPoint],
	pInfo[playerid][PortArme],
	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][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]
	);
	mysql_tquery(g_iHandle, query, "OnQueryFinished", "dd", playerid, THREAD_CREATE_CHAR);
	return 1;
}
Sirop is offline   Reply With Quote
Old 05/08/2016, 07:54 PM   #9
Sirop
Big Clucker
 
Sirop's Avatar
 
Join Date: Oct 2015
Posts: 91
Reputation: 2
Default Re: No save

Quote:
Originally Posted by Fantje View Post
PHP Code:
Champ 'compte' inconnu dans where clause 
translate this please
Champ 'account unknown in where clause

And in my bdd

HTML Code:
CREATE TABLE IF NOT EXISTS `Compte` (
  `ID` int(12) NOT NULL AUTO_INCREMENT,
  `Enregistrer` int(4) DEFAULT '0',
  `Vie` float DEFAULT '0',
  `Gillet` float DEFAULT '0',
  `Masque` int(12) DEFAULT '0',
  `MasqueID` int(12) DEFAULT '0',
  `Faction` int(12) DEFAULT '0',
  `Grade` int(12) DEFAULT '0',
  `Situation` int(4) DEFAULT '0',
  `Mort` int(4) DEFAULT '0',
  `TempsJail` int(12) DEFAULT '0',
  `Warn` int(12) DEFAULT '0',
  `Banned` int(12) DEFAULT '0',
  `Maison` int(12) DEFAULT '0',
  `Commerce_biz` int(12) DEFAULT '0',
  `FactionProprietaire` int(12) DEFAULT '0',
  `Vehicule1` int(12) DEFAULT '0',
  `Vehicule2` int(12) DEFAULT '0',
  `Vehicule3` int(12) DEFAULT '0',
  `Level` int(11) DEFAULT '0',
  `Experience` int(11) DEFAULT '0',
  `MaxExperience` int(11) DEFAULT '0',
  `Skin` int(12) DEFAULT '0',
  `Sexe` int(12) DEFAULT '0',
  `Cash` int(12) DEFAULT '0',
  `CashBanque` int(12) DEFAULT '0',
  `NumeroTel` int(12) DEFAULT '0',
  `Cheque` int(12) DEFAULT '0',
  `Temps` int(12) DEFAULT '0',
  `Amende` int(12) DEFAULT '0',
  `Facture` int(12) DEFAULT '0',
  `Emprunt` int(12) DEFAULT '0',
  `Lotto` int(12) DEFAULT '0',
  `Permis` int(12) DEFAULT '0',
  `PermisPoint` int(12) DEFAULT '0',
  `PortArme` int(12) DEFAULT '0',
  `Montre` int(12) DEFAULT '0',
  `GPS` int(12) DEFAULT '0',
  `Canne` int(12) DEFAULT '0',
  `Telephone` int(12) DEFAULT '0',
  `Credits` int(12) DEFAULT '0',
  `Identite` int(12) DEFAULT '0',
  `GramDrogue1` int(12) DEFAULT '0',
  `GramDrogue2` int(12) DEFAULT '0',
  `GramDrogue3` int(12) DEFAULT '0',
  `Cocaine` int(12) DEFAULT '0',
  `Heroine` int(12) DEFAULT '0',
  `Ecstacy` int(12) DEFAULT '0',
  `Arme1` int(12) DEFAULT '0',
  `Minition1` int(12) DEFAULT '0',
  `Arme2` int(12) DEFAULT '0',
  `Minition2` int(12) DEFAULT '0',
  `Arme3` int(12) DEFAULT '0',
  `Minition3` int(12) DEFAULT '0',
  `Arme4` int(12) DEFAULT '0',
  `Minition4` int(12) DEFAULT '0',
  `Arme5` int(12) DEFAULT '0',
  `Minition5` int(12) DEFAULT '0',
  `Arme6` int(12) DEFAULT '0',
  `Minition6` int(12) DEFAULT '0',
  `Arme7` int(12) DEFAULT '0',
  `Minition7` int(12) DEFAULT '0',
  PRIMARY KEY (`ID`)
) ENGINE=InnoDB  DEFAULT CHARSET=latin1 AUTO_INCREMENT=4 ;
Sirop is offline   Reply With Quote
Old 05/08/2016, 08:38 PM   #10
Stinged
High-roller
 
Join Date: Feb 2013
Posts: 1,571
Reputation: 187
Default Re: No save

Quote:
Originally Posted by Sirop View Post
It still does not work

HTML Code:
SQL_CreationCompte(playerid)
{
	if (!pInfo[playerid][pLogged])
		return 0;

    new
	    query[2048];
	    
    format(query,  sizeof(query), "INSERT INTO `compte` (`ID` \
	`Enregistrer` \
    `Vie` \
    `Gillet` \
    `Masque`  \
    `MasqueID` \
    `Faction` \
    `Grade` \
    `Situation` \
    `Mort` \
    `TempsJail` \
    `Warn` \
    `Banned` \
    `Maison` \
    `Commerce` \
    `FactionProprietaire` \
    `Vehicule1` \
    `Vehicule2` \
    `Vehicule3` \
	`Level` \
    `Experience` \
    `MaxExperience` \
    `Skin` \
    `Sexe` \
    `Cash` \
    `CashBanque` \
    `NumeroTel` \
    `Cheque` \
    `Temps` \
    `Amende` \
    `Facture` \
    `Emprunt` \
    `Lotto` \
    `Permis` \
    `PermisPoint` \
    `PortArme` \
    `Montre` \
    `GPS` \
    `Canne` \
    `Telephone` \
    `Credits` \
    `Identite` \
    `GramDrogue1` \
    `GramDrogue2` \
    `GramDrogue3` \
    `Cocaine` \
    `Heroine` \
    `Ecstacy` \
    `Arme1` \
    `Minition1` \
    `Arme2` \
    `Minition2` \
    `Arme3` \
    `Minition3` \
    `Arme4` \
    `Minition4` \
    `Arme5` \
    `Minition5` \
    `Arme6` \
    `Minition6` \
    `Arme7` \
    `Minition7` \
    VALUES('%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d', '%d')",
	pInfo[playerid][pID],
	pInfo[playerid][Registered],
	pInfo[playerid][Health],
	pInfo[playerid][Armour],
	pInfo[playerid][Mask],
	pInfo[playerid][MaskID],
	pInfo[playerid][SecteID],
	pInfo[playerid][Grade],
	pInfo[playerid][LastPos],
	pInfo[playerid][Mort],
	pInfo[playerid][JailTime],
	pInfo[playerid][Warn],
	pInfo[playerid][Baned],
	pInfo[playerid][HouseOwner],
	pInfo[playerid][BizOwner],
	pInfo[playerid][FacOwner],
	pInfo[playerid][VehicleOwner],
	pInfo[playerid][VehicleOwner2],
	pInfo[playerid][VehicleOwner3],
	pInfo[playerid][Level],
	pInfo[playerid][Exp],
	pInfo[playerid][MaxExp],
	pInfo[playerid][Skin],
	pInfo[playerid][Gender],
	pInfo[playerid][HandMoney],
	pInfo[playerid][BankMoney],
	pInfo[playerid][PhoneNumber],
	pInfo[playerid][PayeCheck],
	pInfo[playerid][PayeTime],
	pInfo[playerid][Amende],
	pInfo[playerid][Facture],
	pInfo[playerid][Emprunt],
	pInfo[playerid][Lotto],
	pInfo[playerid][Permis],
	pInfo[playerid][PermisPoint],
	pInfo[playerid][PortArme],
	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][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]
	);
	mysql_tquery(g_iHandle, query, "OnQueryFinished", "dd", playerid, THREAD_CREATE_CHAR);
	return 1;
}
Commas (,) are missing.

Code:
format(query,  sizeof(query), "INSERT INTO `compte` (`ID`, \
	`Enregistrer`, \
    `Vie`, \
Stinged is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[save error] my backpack save system Donggyu Scripting Help 0 09/06/2016 05:39 PM
Why my samp wont save positions while i do /save? GTLS Client Support 15 17/05/2015 05:44 AM
How do i add save kills and save deaths to my admin script? HayZatic Help Archive 2 09/07/2011 11:13 PM
guys i need help how to save money in this script i created a file but it wont save Artix Help Archive 5 30/05/2011 09:03 PM
I Made a save command that AddStaticVehicle saves. But how to save the colors? RyDeR` Help Archive 2 04/08/2009 09:20 PM


All times are GMT. The time now is 01:06 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.