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;
}
Champ 'compte' inconnu dans where clause
INSERT INTO `table_name` (`Field_1`, `Field_2`, `Field_3`) VALUES (Value_1, Value_2, Value_3)
|
PHP Code:
|
|
I do not understand these tutorials though the syntax is good I do not understand
|
INSERT INTO `compte` (`ID` = %d, `Enregistrer` = %d) VALUES (%d, %d)
INSERT INTO `compte` (`ID`, `Enregistrer`) VALUES (%d, %d)
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;
}
|
PHP 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 ;
|
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;
}
|
format(query, sizeof(query), "INSERT INTO `compte` (`ID`, \
`Enregistrer`, \
`Vie`, \
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')",
|
Commas (,) are missing.
Code:
format(query, sizeof(query), "INSERT INTO `compte` (`ID`, \
`Enregistrer`, \
`Vie`, \
|
|
You will still have to fix this line
Code:
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')",
|
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);
mysql_tquery(g_iHandle, query);
return 1;
}