04.06.2015, 22:02
(
Последний раз редактировалось GloomY; 04.06.2015 в 22:04.
Причина: Thread name
)
I have a problem with not updating all the database of a players account. It updates to LoginDate, everything else stays at 0. I can't seem to find a problem. It worked well untill I started to add more lines of mysql_format because the variable wouldn't allow me to put them all in one line.
This is the code:
This is the code:
PHP код:
new query[3096];
new Float:x, Float:y, Float:z, Float:a;
GetPlayerPos(playerid, x, y, z);
GetPlayerFacingAngle(playerid, a);
mysql_format(mysql, query, sizeof(query), "UPDATE `accounts` SET`Admin`= %d, `GameMaster`= %d, `VIP`= %d, `Money`= %d, `Registered`= %d, `Tutorial`= %d WHERE `ID`= '%d'",\
pInfo[playerid][pAdmin], pInfo[playerid][pGameMaster], pInfo[playerid][pVIP], pInfo[playerid][pMoney], pInfo[playerid][pRegistered], pInfo[playerid][pTutorial], pInfo[playerid][pID]);
mysql_format(mysql, query, sizeof(query), "UPDATE `accounts` SET`RegisterDate`= %d, `LoginDate`= %d, `Gender`= %d, `Age`= %d, `Origin`= %e, `Respect`= %d, `Money`= %d, `Bank`= %d, `Skin`= %d WHERE `ID`= '%d'",\
pInfo[playerid][pRegisterDate], pInfo[playerid][pLoginDate], pInfo[playerid][pGender], pInfo[playerid][pAge], pInfo[playerid][pOrigin], pInfo[playerid][pRespect], pInfo[playerid][pMoney], pInfo[playerid][pBank], pInfo[playerid][pSkin], pInfo[playerid][pID]);
mysql_format(mysql, query, sizeof(query), "UPDATE `accounts` SET`Interior`= %d, `World`= %d, `Jailed`= %d, `JailTime`= %d, `Muted`= %d, `Warnings`= %d, `Warn1`= %e, `Warn2`= %e, `Job`= %d WHERE `ID`= '%d'",\
pInfo[playerid][pInterior], pInfo[playerid][pWorld], pInfo[playerid][pJailed], pInfo[playerid][pJailTime], pInfo[playerid][pMuted], pInfo[playerid][pWarnings], pInfo[playerid][pWarn1], pInfo[playerid][pWarn2], pInfo[playerid][pJob], pInfo[playerid][pID]);
mysql_format(mysql, query, sizeof(query), "UPDATE `accounts` SET`PlayingHours`= %d, `PlayingMinutes`= %d, `House`= %d, `Business`= %d, `Phone`= %d, `Faction`= %d, `FactionRank`= %d, `MaskID`= %d WHERE `ID`= '%d'",\
pInfo[playerid][pPlayingHours], pInfo[playerid][pPlayingMinutes], pInfo[playerid][pHouse], pInfo[playerid][pBusiness], pInfo[playerid][pPhone], pInfo[playerid][pFaction], pInfo[playerid][pFactionRank], pInfo[playerid][pMaskID], pInfo[playerid][pID]);
mysql_format(mysql, query, sizeof(query), "UPDATE `accounts` SET`Married`= %d, `MarriedTo`= %e, `Watch`= %d, `Ciggaretes`= %d, `Lighter`= %d WHERE `ID`= '%d'",\
pInfo[playerid][pMarried], pInfo[playerid][pMarriedTo], pInfo[playerid][pWatch], pInfo[playerid][pCiggaretes], pInfo[playerid][pLighter], pInfo[playerid][pID]);
for (new i = 0; i < 13; i ++)
{
mysql_format(mysql, query, sizeof(query), "%s, `Gun%d` = '%d', `Ammo%d` = '%d'", query, i + 1, pInfo[playerid][pGuns][i], i + 1, pInfo[playerid][pAmmo][i]);
}
mysql_tquery(mysql, query, "", "");
Код:
[23:53:27] [DEBUG] mysql_format - connection: 1, len: 3096, format: "UPDATE `accounts` SET`Admin`= %d, `GameMaster`= %d, `VIP`= %d, `Money`= %d, `Registered`= %d, `Tutorial`= %d WHERE `ID`= '%d'" [23:53:27] [DEBUG] mysql_format - connection: 1, len: 3096, format: "UPDATE `accounts` SET`RegisterDate`= %d, `LoginDate`= %d, `Gender`= %d, `Age`= %d, `Origin`= %e, `Respect`= %d, `Money`= %d, `Ba..." [23:53:27] [DEBUG] mysql_format - connection: 1, len: 3096, format: "UPDATE `accounts` SET`Interior`= %d, `World`= %d, `Jailed`= %d, `JailTime`= %d, `Muted`= %d, `Warnings`= %d, `Warn1`= %e, `Warn2..." [23:53:27] [DEBUG] mysql_format - connection: 1, len: 3096, format: "UPDATE `accounts` SET`PlayingHours`= %d, `PlayingMinutes`= %d, `House`= %d, `Business`= %d, `Phone`= %d, `Faction`= %d, `Faction..." [23:53:27] [DEBUG] mysql_format - connection: 1, len: 3096, format: "UPDATE `accounts` SET`Married`= %d, `MarriedTo`= %e, `Watch`= %d, `Ciggaretes`= %d, `Lighter`= %d WHERE `ID`= '%d'" [23:53:27] [DEBUG] mysql_format - connection: 1, len: 3096, format: "%s, `Gun%d` = '%d', `Ammo%d` = '%d'" [23:53:27] [DEBUG] mysql_format - connection: 1, len: 3096, format: "%s, `Gun%d` = '%d', `Ammo%d` = '%d'" [23:53:27] [DEBUG] mysql_format - connection: 1, len: 3096, format: "%s, `Gun%d` = '%d', `Ammo%d` = '%d'" [23:53:27] [DEBUG] mysql_format - connection: 1, len: 3096, format: "%s, `Gun%d` = '%d', `Ammo%d` = '%d'" [23:53:27] [DEBUG] mysql_format - connection: 1, len: 3096, format: "%s, `Gun%d` = '%d', `Ammo%d` = '%d'" [23:53:27] [DEBUG] mysql_format - connection: 1, len: 3096, format: "%s, `Gun%d` = '%d', `Ammo%d` = '%d'" [23:53:27] [DEBUG] mysql_format - connection: 1, len: 3096, format: "%s, `Gun%d` = '%d', `Ammo%d` = '%d'" [23:53:27] [DEBUG] mysql_format - connection: 1, len: 3096, format: "%s, `Gun%d` = '%d', `Ammo%d` = '%d'" [23:53:27] [DEBUG] mysql_format - connection: 1, len: 3096, format: "%s, `Gun%d` = '%d', `Ammo%d` = '%d'" [23:53:27] [DEBUG] mysql_format - connection: 1, len: 3096, format: "%s, `Gun%d` = '%d', `Ammo%d` = '%d'" [23:53:27] [DEBUG] mysql_format - connection: 1, len: 3096, format: "%s, `Gun%d` = '%d', `Ammo%d` = '%d'" [23:53:27] [DEBUG] mysql_format - connection: 1, len: 3096, format: "%s, `Gun%d` = '%d', `Ammo%d` = '%d'" [23:53:27] [DEBUG] mysql_format - connection: 1, len: 3096, format: "%s, `Gun%d` = '%d', `Ammo%d` = '%d'" [23:53:27] [DEBUG] mysql_tquery - connection: 1, query: "UPDATE `accounts` SET`Married`= 0, `MarriedTo`= , `Watch`= 0, `C", callback: "(null)", format: "(null)" [23:53:27] [DEBUG] CMySQLQuery::Execute[] - starting query execution [23:53:27] [ERROR] CMySQLQuery::Execute[] - (error #1064) Erreur de syntaxe prčs de ' `Watch`= 0, `Ciggaretes`= 0, `Lighter`= 0 WHERE `ID`= '1', `Gun1` = '0', `Ammo1' ŕ la ligne 1 [23:53:27] [DEBUG] CMySQLQuery::Execute[] - error will be triggered in OnQueryError