PDA

View Full Version : MYSQL Help!


Kenway
17/04/2014, 10:24 AM
I have This error:
Description: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '`Hunger` = 100, `HungerTimer` = 16, `HungerDeathTimer` = 5, `ForcePasswordChange' at line 1 (index 0). Query:

This is the code:
stock g_mysql_SaveAccount(playerid)
{
new query[2048];

format(query, sizeof(query), "UPDATE `accounts` SET \
`IP` = '%s', \
`Registered` = %d, \
`ConnectedTime` = %d, \
`Sex` = %d, \
`BirthDate` = %d, \
`Band` = %d, \
`PermBand` = %d, \
`Warnings` = %d, \
`Disabled` = %d, \
`Level` = %d, \
`AdminLevel` = %d, \
`SeniorModerator` = %d, \
`Helper` = %d, \
`DonateRank` = %d, \
`Respect` = %d, \
`XP` = %d, \
`Money` = %d, \
`Bank` = %d,",
PlayerInfo[playerid][pIP],
PlayerInfo[playerid][pReg],
PlayerInfo[playerid][pConnectHours],
PlayerInfo[playerid][pSex],
PlayerInfo[playerid][pBirthDate],
PlayerInfo[playerid][pBanned],
PlayerInfo[playerid][pPermaBanned],
PlayerInfo[playerid][pWarns],
PlayerInfo[playerid][pDisabled],
PlayerInfo[playerid][pLevel],
PlayerInfo[playerid][pAdmin],
PlayerInfo[playerid][pSMod],
PlayerInfo[playerid][pHelper],
PlayerInfo[playerid][pDonateRank],
PlayerInfo[playerid][pExp],
PlayerInfo[playerid][pXP],
GetPlayerCash(playerid),
PlayerInfo[playerid][pAccount]
);

format(query, sizeof(query), "%s \
`pHealth` = %0.5f, \
`pArmor` = %0.5f, \
`pSHealth` = %0.5f, \
`Int` = %d, \
`VirtualWorld` = %d, \
`Model` = %d, \
`SPos_x` = %0.5f, \
`SPos_y` = %0.5f, \
`SPos_z` = %0.5f, \
`SPos_r` = %0.5f, \
`BanAppealer` = %d, \
`PR` = %d, \
`ShopTech` = %d, \
`Undercover` = %d, \
`TogReports` = %d,",
query,
PlayerInfo[playerid][pHealth],
PlayerInfo[playerid][pArmor],
PlayerInfo[playerid][pSHealth],
PlayerInfo[playerid][pInt],
PlayerInfo[playerid][pVW],
PlayerInfo[playerid][pModel],
PlayerInfo[playerid][pPos_x],
PlayerInfo[playerid][pPos_y],
PlayerInfo[playerid][pPos_z],
PlayerInfo[playerid][pPos_r],
PlayerInfo[playerid][pBanAppealer],
PlayerInfo[playerid][pPR],
PlayerInfo[playerid][pShopTech],
PlayerInfo[playerid][pUndercover],
PlayerInfo[playerid][pTogReports]
);

format(query, sizeof(query), "%s \
`Radio` = %d, \
`RadioFreq` = %d, \
`UpgradePoints` = %d, \
`Origin` = %d, \
`Muted` = %d, \
`Crimes` = %d, \
`Accent` = %d, \
`CHits` = %d, \
`FHits` = %d, \
`Arrested` = %d, \
`Phonebook` = %d, \
`LottoNr` = %d, \
`Fishes` = %d, \
`BiggestFish` = %d, \
`Job` = %d,",
query,
PlayerInfo[playerid][pRadio],
PlayerInfo[playerid][pRadioFreq],
PlayerInfo[playerid][gPupgrade],
PlayerInfo[playerid][pOrigin],
PlayerInfo[playerid][pMuted],
PlayerInfo[playerid][pCrimes],
PlayerInfo[playerid][pAccent],
PlayerInfo[playerid][pCHits],
PlayerInfo[playerid][pFHits],
PlayerInfo[playerid][pArrested],
PlayerInfo[playerid][pPhoneBook],
PlayerInfo[playerid][pLottoNr],
PlayerInfo[playerid][pFishes],
PlayerInfo[playerid][pBiggestFish],
PlayerInfo[playerid][pJob]
);

format(query, sizeof(query), "%s \
`Job2` = %d, \
`Paycheck` = %d, \
`HeadValue` = %d, \
`JailTime` = %d, \
`WRestricted` = %d, \
`Materials` = %d, \
`Crates` = %d, \
`Pot` = %d, \
`Crack` = %d, \
`Leader` = %d, \
`Member` = %d, \
`Division` = %d, \
`FMember` = %d,",
query,
PlayerInfo[playerid][pJob2],
PlayerInfo[playerid][pPayCheck],
PlayerInfo[playerid][pHeadValue],
PlayerInfo[playerid][pJailTime],
PlayerInfo[playerid][pWRestricted],
PlayerInfo[playerid][pMats],
PlayerInfo[playerid][pCrates],
PlayerInfo[playerid][pPot],
PlayerInfo[playerid][pCrack],
PlayerInfo[playerid][pLeader],
PlayerInfo[playerid][pMember],
PlayerInfo[playerid][pDivision],
PlayerInfo[playerid][pFMember]
);

format(query, sizeof(query), "%s \
`Rank` = %d, \
`DetSkill` = %d, \
`SexSkill` = %d, \
`BoxSkill` = %d, \
`LawSkill` = %d, \
`MechSkill` = %d, \
`TruckSkill` = %d, \
`DrugsSkill` = %d, \
`ArmsSkill` = %d, \
`SmugglerSkill` = %d, \
`FishSkill` = %d, \
`CheckCash` = %d,",
query,
PlayerInfo[playerid][pRank],
PlayerInfo[playerid][pDetSkill],
PlayerInfo[playerid][pSexSkill],
PlayerInfo[playerid][pBoxSkill],
PlayerInfo[playerid][pLawSkill],
PlayerInfo[playerid][pMechSkill],
PlayerInfo[playerid][pTruckSkill],
PlayerInfo[playerid][pDrugsSkill],
PlayerInfo[playerid][pArmsSkill],
PlayerInfo[playerid][pSmugSkill],
PlayerInfo[playerid][pFishSkill],
PlayerInfo[playerid][pCheckCash]
);

format(query, sizeof(query), "%s \
`Checks` = %d, \
`BoatLic` = %d, \
`FlyLic` = %d, \
`GunLic` = %d, \
`FishLic` = %d, \
`FishSkill` = %d, \
`FightingStyle` = %d, \
`PhoneNr` = %d, \
`Apartment` = %d, \
`Apartment2` = %d, \
`Renting` = %d, \
`CarLic` = %d \
WHERE `id` = '%d'",
query,
PlayerInfo[playerid][pChecks],
PlayerInfo[playerid][pBoatLic],
PlayerInfo[playerid][pFlyLic],
PlayerInfo[playerid][pGunLic],
PlayerInfo[playerid][pFishLic],
PlayerInfo[playerid][pFishSkill],
PlayerInfo[playerid][pFightStyle],
PlayerInfo[playerid][pPnumber],
PlayerInfo[playerid][pPhousekey],
PlayerInfo[playerid][pPhousekey2],
PlayerInfo[playerid][pRenting],
PlayerInfo[playerid][pCarLic],
GetPlayerSQLId(playerid)
);

mysql_function_query(MainPipeline, query, false, "OnQueryFinish", "ii", SENDDATA_THREAD, playerid);

format(query, sizeof(query), "UPDATE `accounts` SET \
`DrugsTime` = %d, \
`LawyerTime` = %d, \
`LawyerFreeTime` = %d, \
`MechTime` = %d, \
`SexTime` = %d, \
`PayDay` = %d, \
`PayDayHad` = %d, \
`CDPlayer` = %d, \
`Dice` = %d, \
`Spraycan` = %d, \
`Rope` = %d, \
`Cigars` = %d, \
`Sprunk` = %d, \
`Bombs` = %d, \
`Wins` = %d,",
PlayerInfo[playerid][pDrugsTime],
PlayerInfo[playerid][pLawyerTime],
PlayerInfo[playerid][pLawyerFreeTime],
PlayerInfo[playerid][pMechTime],
PlayerInfo[playerid][pSexTime],
PlayerInfo[playerid][pConnectSeconds],
PlayerInfo[playerid][pPayDayHad],
PlayerInfo[playerid][pCDPlayer],
PlayerInfo[playerid][pDice],
PlayerInfo[playerid][pSpraycan],
PlayerInfo[playerid][pRope],
PlayerInfo[playerid][pCigar],
PlayerInfo[playerid][pSprunk],
PlayerInfo[playerid][pBombs],
PlayerInfo[playerid][pWins]
);

for(new i = 0; i < 12; i++)
{
format(query, sizeof(query), "%s `Gun%d` = %d,", query, i, PlayerInfo[playerid][pGuns][i]);
}

format(query, sizeof(query), "%s \
`Loses` = %d, \
`Tutorial` = %d, \
`OnDuty` = %d, \
`Hospital` = %d, \
`Married` = %d, \
`MarriedTo` = '%s', \
`ContractBy` = '%s', \
`ContractDetail` = '%s', \
`WantedLevel` = %d, \
`Insurance` = %d, \
`NewMuted` = %d, \
`NewMutedTotal` = %d, \
`AdMuted` = %d, \
`911Muted` = %d, \
`AdMutedTotal` = %d,",
query,
PlayerInfo[playerid][pLoses],
PlayerInfo[playerid][pTut],
PlayerInfo[playerid][pDuty],
PlayerInfo[playerid][pHospital],
PlayerInfo[playerid][pMarriedID],
PlayerInfo[playerid][pMarriedName],
PlayerInfo[playerid][pContractBy],
g_mysql_ReturnEscaped(PlayerInfo[playerid][pContractDetail], MainPipeline),
PlayerInfo[playerid][pWantedLevel],
PlayerInfo[playerid][pInsurance],
PlayerInfo[playerid][pNMute],
PlayerInfo[playerid][pNMuteTotal],
PlayerInfo[playerid][pADMute],
PlayerInfo[playerid][p911Muted],
PlayerInfo[playerid][pADMuteTotal]
);

format(query, sizeof(query), "%s \
`HelpMute` = %d, \
`Helper` = %d, \
`ReportMuted` = %d, \
`ReportMutedTotal` = %d, \
`ReportMutedTime` = %d, \
`DMRMuted` = %d, \
`VIPMuted` = %d, \
`VIPMutedTime` = %d, \
`GiftTime` = %d, \
`AdvisorDutyHours` = %d, \
`AcceptedHelp` = %d, \
`AcceptReport` = %d, \
`TrashReport` = %d, \
`FactionModerator` = %d, \
`GangModerator` = %d, \
`GangWarn` = %d,",
query,
PlayerInfo[playerid][pHelpMute],
PlayerInfo[playerid][pHelper],
PlayerInfo[playerid][pRMuted],
PlayerInfo[playerid][pRMutedTotal],
PlayerInfo[playerid][pRMutedTime],
PlayerInfo[playerid][pDMRMuted],
PlayerInfo[playerid][pVMuted],
PlayerInfo[playerid][pVMutedTime],
PlayerInfo[playerid][pGiftTime],
PlayerInfo[playerid][pDutyHours],
PlayerInfo[playerid][pAcceptedHelp],
PlayerInfo[playerid][pAcceptReport],
PlayerInfo[playerid][pTrashReport],
PlayerInfo[playerid][pFactionModerator],
PlayerInfo[playerid][pGangModerator],
PlayerInfo[playerid][pGangWarn]
);

format(query, sizeof(query), "%s \
`CSFBanned` = %d, \
`VIPInviteDay` = %d, \
`TempVIP` = %d, \
`BuddyInvite` = %d, \
`Tokens` = %d, \
`PTokens` = %d, \
`TriageTime` = %d, \
`PrisonedBy` = '%s', \
`PrisonReason` = '%s', \
`TaxiLicense` = %d, \
`TicketTime` = %d, \
`Screwdriver` = %d, \
`Smslog` = %d, \
`Speedo` = %d \
WHERE `id` = '%d'",
query,
PlayerInfo[playerid][pCSFBanned],
PlayerInfo[playerid][pVIPInviteDay],
PlayerInfo[playerid][pTempVIP],
PlayerInfo[playerid][pBuddyInvited],
PlayerInfo[playerid][pTokens],
PlayerInfo[playerid][pPaintTokens],
PlayerInfo[playerid][pTriageTime],
PlayerInfo[playerid][pPrisonedBy],
g_mysql_ReturnEscaped(PlayerInfo[playerid][pPrisonReason], MainPipeline),
PlayerInfo[playerid][pTaxiLicense],
PlayerInfo[playerid][pTicketTime],
PlayerInfo[playerid][pScrewdriver],
PlayerInfo[playerid][pSmslog],
PlayerInfo[playerid][pSpeedo],
GetPlayerSQLId(playerid)
);

mysql_function_query(MainPipeline, query, false, "OnQueryFinish", "ii", SENDDATA_THREAD, playerid);

format(query, sizeof(query), "UPDATE `accounts` SET \
`Wristwatch` = %d, \
`Surveillance` = %d, \
`Tire` = %d, \
`Firstaid` = %d, \
`Rccam` = %d, \
`Receiver` = %d, \
`GPS` = %d, \
`Sweep` = %d, \
`SweepLeft` = %d, \
`Bugged` = %d,",
query,
PlayerInfo[playerid][pWristwatch],
PlayerInfo[playerid][pSurveillance],
PlayerInfo[playerid][pTire],
PlayerInfo[playerid][pFirstaid],
PlayerInfo[playerid][pRccam],
PlayerInfo[playerid][pReceiver],
PlayerInfo[playerid][pGPS],
PlayerInfo[playerid][pSweep],
PlayerInfo[playerid][pSweepLeft],
PlayerInfo[playerid][pBugged]
);

format(query, sizeof(query), "%s \
`pWExists` = %d, \
`pWSeeds` = %d, \
`Warrants` = %d, \
`JudgeJailTime` = %d, \
`JudgeJailType` = %d, \
`BeingSentenced` = %d, \
`ProbationTime` = %d, \
`DMKills` = %d,",
query,
PlayerInfo[playerid][pWeedObject],
PlayerInfo[playerid][pWSeeds],
PlayerInfo[playerid][pWarrant],
PlayerInfo[playerid][pJudgeJailTime],
PlayerInfo[playerid][pJudgeJailType],
PlayerInfo[playerid][pBeingSentenced],
PlayerInfo[playerid][pProbationTime],
PlayerInfo[playerid][pDMKills]
);

format(query, sizeof(query), "%s \
`OrderConfirmed` = %d, \
`FreezeHouse` = %d, \
`FreezeCar` = %d, \
`Firework` = %d, \
`Boombox` = %d, \
`Hydration` = %d, \
`DoubleEXP` = %d, \
`EXPToken` = %d, \
`RacePlayerLaps` = %d, \
`Ringtone` = %d,",
query,
PlayerInfo[playerid][pOrderConfirmed],
PlayerInfo[playerid][pFreezeHouse],
PlayerInfo[playerid][pFreezeCar],
PlayerInfo[playerid][pFirework],
PlayerInfo[playerid][pBoombox],
PlayerInfo[playerid][pHydration],
PlayerInfo[playerid][pDoubleEXP],
PlayerInfo[playerid][pEXPToken],
PlayerInfo[playerid][pRacePlayerLaps],
PlayerInfo[playerid][pRingtone]
);

format(query, sizeof(query), "%s \
`Order` = %d, \
`CallsAccepted` = %d, \
`PatientsDelivered` = %d, \
`LiveBanned` = %d, \
`FreezeBank` = %d, \
`VIPM` = %d, \
`VIPMO` = %d, \
`VIPExpire` = %d, \
`GVip` = %d, \
`Watchdog` = %d, \
`VIPSold` = %d, \
`GoldBoxTokens` = %d, \
`DrawChance` = %d, \
`RewardHours` = %.2f, \
`CarsRestricted` = %d, \
`LastCarWarning` = %d, \
`CarWarns` = %d, \
`Flagged` = %d \
WHERE `id` = '%d'",
query,
PlayerInfo[playerid][pOrder],
PlayerInfo[playerid][pCallsAccepted],
PlayerInfo[playerid][pPatientsDelivered],
PlayerInfo[playerid][pLiveBanned],
PlayerInfo[playerid][pFreezeBank],
PlayerInfo[playerid][pVIPM],
PlayerInfo[playerid][pVIPMO],
PlayerInfo[playerid][pVIPExpire],
PlayerInfo[playerid][pGVip],
PlayerInfo[playerid][pWatchdog],
PlayerInfo[playerid][pVIPSold],
PlayerInfo[playerid][pGoldBoxTokens],
PlayerInfo[playerid][pRewardDrawChance],
PlayerInfo[playerid][pRewardHours],
PlayerInfo[playerid][pRVehRestricted],
PlayerInfo[playerid][pLastRVehWarn],
PlayerInfo[playerid][pRVehWarns],
PlayerInfo[playerid][pFlagged],
GetPlayerSQLId(playerid)
);
mysql_function_query(MainPipeline, query, false, "OnQueryFinish", "ii", SENDDATA_THREAD, playerid);

format(query, sizeof(query), "%s \
`Hunger` = '%d', \
`HungerTimer` = '%d', \
`HungerDeathTimer` = '%d', \
`ForcePasswordChange` = '%d', \
`Fitness` = %d, \
`Credits` = %d, \
`HealthCare` = %d, \
`TotalCredits` = %d, \
`ReceivedCredits` = %d, \
`RimMod` = %d, \
`MailEnabled` = %d, \
`Paper` = %d, \
`Mailbox` = %d, \
`Business` = %d, \
`BusinessRank` = %d, \
`TreasureSkill` = %d, \
`MetalDetector` = %d, \
`HelpedBeforer` = %d,",
query,
PlayerInfo[playerid][pHunger],
PlayerInfo[playerid][pHungerTimer],
PlayerInfo[playerid][pHungerDeathTimer],
PlayerInfo[playerid][pForcePasswordChange],
PlayerInfo[playerid][pFitness],
PlayerInfo[playerid][pCredits],
PlayerInfo[playerid][pHealthCare],
PlayerInfo[playerid][pTotalCredits],
PlayerInfo[playerid][pReceivedCredits],
PlayerInfo[playerid][pRimMod],
PlayerInfo[playerid][pMailEnabled],
PlayerInfo[playerid][pPaper],
PlayerInfo[playerid][pMailbox],
PlayerInfo[playerid][pBusiness],
PlayerInfo[playerid][pBusinessRank],
PlayerInfo[playerid][pTreasureSkill],
PlayerInfo[playerid][pMetalDetector],
PlayerInfo[playerid][pHelpedBefore]
);

format(query, sizeof(query), "%s \
`Trickortreat` = %d, \
`LastCharmReceived` = %d, \
`RHMutes` = %d, \
`RHMuteTime` = %d, \
`GiftCode` = %d, \
`Table` = %d, \
`OpiumSeeds` = %d, \
`RawOpium` = %d, \
`Heroin` = %d, \
`Syringes` = %d, \
`Skins` = %d, \
`HasTazer` = %d, \
`HasCuff` = %d, \
`CarVoucher` = %d, \
`ReferredBy` = %s, \
`PendingRefReward` = %d, \
`Refers` = %d, \
`Famed` = %d,",
query,
PlayerInfo[playerid][pTrickortreat],
PlayerInfo[playerid][pLastCharmReceived],
PlayerInfo[playerid][pRHMutes],
PlayerInfo[playerid][pRHMuteTime],
PlayerInfo[playerid][pGiftCode],
PlayerInfo[playerid][pTable],
PlayerInfo[playerid][pOpiumSeeds],
PlayerInfo[playerid][pRawOpium],
PlayerInfo[playerid][pHeroin],
PlayerInfo[playerid][pSyringes],
PlayerInfo[playerid][pSkins],
PlayerInfo[playerid][pHasTazer],
PlayerInfo[playerid][pHasCuff],
PlayerInfo[playerid][pCarVoucher],
g_mysql_ReturnEscaped(PlayerInfo[playerid][pReferredBy], MainPipeline),
PlayerInfo[playerid][pPendingRefReward],
PlayerInfo[playerid][pRefers],
PlayerInfo[playerid][pFamed]
);

format(query, sizeof(query), "%s \
`FMuted` = %d, \
`DefendTime` = %d, \
`PVIPVoucher` = %d, \
`VehicleSlot` = %d, \
`ToySlot` = %d, \
`RFLTeam` = %d, \
`RFLTeamL` = %d, \
`VehVoucher` = %d, \
`SVIPVoucher` = %d, \
`GVIPVoucher` = %d, \
`GiftVoucher` = %d, \
`FallIntoFun` = %d, \
`HungerVoucher` = %d, \
`BoughtCure` = %d, \
`Vials` = %d, \
`AdvertVoucher` = %d, \
`ShopCounter` = %d, \
`ShopNotice` = %d, \
`SVIPExVoucher` = %d, \
`GVIPExVoucher` = %d, \
`VIPSellable` = %d, \
`ReceivedPrize` = %d, \
WHERE `id` = '%d'",
query,
PlayerInfo[playerid][pFMuted],
PlayerInfo[playerid][pDefendTime],
PlayerInfo[playerid][pPVIPVoucher],
PlayerInfo[playerid][pVehicleSlot],
PlayerInfo[playerid][pToySlot],
PlayerInfo[playerid][pRFLTeam],
PlayerInfo[playerid][pRFLTeamL],
PlayerInfo[playerid][pVehVoucher],
PlayerInfo[playerid][pSVIPVoucher],
PlayerInfo[playerid][pGVIPVoucher],
PlayerInfo[playerid][pGiftVoucher],
PlayerInfo[playerid][pFallIntoFun],
PlayerInfo[playerid][pHungerVoucher],
PlayerInfo[playerid][pBoughtCure],
PlayerInfo[playerid][pVials],
PlayerInfo[playerid][pAdvertVoucher],
PlayerInfo[playerid][pShopCounter],
PlayerInfo[playerid][pShopNotice],
PlayerInfo[playerid][pSVIPExVoucher],
PlayerInfo[playerid][pGVIPExVoucher],
PlayerInfo[playerid][pVIPSellable],
PlayerInfo[playerid][pReceivedPrize],
GetPlayerSQLId(playerid)
);

mysql_function_query(MainPipeline, query, false, "OnQueryFinish", "ii", SENDDATA_THREAD, playerid);
MySQLUpdateFinish(query, GetPlayerSQLId(playerid));
return 1;
}

S4t3K
17/04/2014, 10:31 AM
I don't understand at all.

Firstly, why do you use \ in your MySQL syntax ?
Secondly, why do you use "%s" (query) in the format of query ?
It looks like I go to supermarket, I take stuff, and I eat this stuff in supermarket, without paying (paying corresponds to the moment where the format function is proceeded).
Thirdly, why do you made this query for ?

DobbysGamertag
17/04/2014, 10:38 AM
Try:

format(query,sizeof(query),"%s `hunger`='%d'`,`HungerTimer`='%d',`HungerDeathTime r`='%d',`ForcePasswordChange`='%d'");


Also, why arent you using INSERT UPDATE or SELECT or WHERE? its got to have some form of table/field. Or am i missing something. I attempted to use \ in queries once, i failed :P so i stopped doing it.

Kenway
17/04/2014, 11:24 AM
This is my Saving account system thats only little part of the code.

S4t3K
17/04/2014, 11:28 AM
Well, we can't help you on the whole code if we just have a (quite) little part of the code.
The error may be on each part of the query : we can't guess on which it is.

Kenway
17/04/2014, 11:49 AM
Okay, This is the full code:

stock g_mysql_SaveAccount(playerid)
{
new query[2048];

format(query, sizeof(query), "UPDATE `accounts` SET \
`IP` = '%s', \
`Registered` = %d, \
`ConnectedTime` = %d, \
`Sex` = %d, \
`BirthDate` = %d, \
`Band` = %d, \
`PermBand` = %d, \
`Warnings` = %d, \
`Disabled` = %d, \
`Level` = %d, \
`AdminLevel` = %d, \
`SeniorModerator` = %d, \
`Helper` = %d, \
`DonateRank` = %d, \
`Respect` = %d, \
`XP` = %d, \
`Money` = %d, \
`Bank` = %d,",
PlayerInfo[playerid][pIP],
PlayerInfo[playerid][pReg],
PlayerInfo[playerid][pConnectHours],
PlayerInfo[playerid][pSex],
PlayerInfo[playerid][pBirthDate],
PlayerInfo[playerid][pBanned],
PlayerInfo[playerid][pPermaBanned],
PlayerInfo[playerid][pWarns],
PlayerInfo[playerid][pDisabled],
PlayerInfo[playerid][pLevel],
PlayerInfo[playerid][pAdmin],
PlayerInfo[playerid][pSMod],
PlayerInfo[playerid][pHelper],
PlayerInfo[playerid][pDonateRank],
PlayerInfo[playerid][pExp],
PlayerInfo[playerid][pXP],
GetPlayerCash(playerid),
PlayerInfo[playerid][pAccount]
);

format(query, sizeof(query), "%s \
`pHealth` = %0.5f, \
`pArmor` = %0.5f, \
`pSHealth` = %0.5f, \
`Int` = %d, \
`VirtualWorld` = %d, \
`Model` = %d, \
`SPos_x` = %0.5f, \
`SPos_y` = %0.5f, \
`SPos_z` = %0.5f, \
`SPos_r` = %0.5f, \
`BanAppealer` = %d, \
`PR` = %d, \
`ShopTech` = %d, \
`Undercover` = %d, \
`TogReports` = %d,",
query,
PlayerInfo[playerid][pHealth],
PlayerInfo[playerid][pArmor],
PlayerInfo[playerid][pSHealth],
PlayerInfo[playerid][pInt],
PlayerInfo[playerid][pVW],
PlayerInfo[playerid][pModel],
PlayerInfo[playerid][pPos_x],
PlayerInfo[playerid][pPos_y],
PlayerInfo[playerid][pPos_z],
PlayerInfo[playerid][pPos_r],
PlayerInfo[playerid][pBanAppealer],
PlayerInfo[playerid][pPR],
PlayerInfo[playerid][pShopTech],
PlayerInfo[playerid][pUndercover],
PlayerInfo[playerid][pTogReports]
);

format(query, sizeof(query), "%s \
`Radio` = %d, \
`RadioFreq` = %d, \
`UpgradePoints` = %d, \
`Origin` = %d, \
`Muted` = %d, \
`Crimes` = %d, \
`Accent` = %d, \
`CHits` = %d, \
`FHits` = %d, \
`Arrested` = %d, \
`Phonebook` = %d, \
`LottoNr` = %d, \
`Fishes` = %d, \
`BiggestFish` = %d, \
`Job` = %d,",
query,
PlayerInfo[playerid][pRadio],
PlayerInfo[playerid][pRadioFreq],
PlayerInfo[playerid][gPupgrade],
PlayerInfo[playerid][pOrigin],
PlayerInfo[playerid][pMuted],
PlayerInfo[playerid][pCrimes],
PlayerInfo[playerid][pAccent],
PlayerInfo[playerid][pCHits],
PlayerInfo[playerid][pFHits],
PlayerInfo[playerid][pArrested],
PlayerInfo[playerid][pPhoneBook],
PlayerInfo[playerid][pLottoNr],
PlayerInfo[playerid][pFishes],
PlayerInfo[playerid][pBiggestFish],
PlayerInfo[playerid][pJob]
);

format(query, sizeof(query), "%s \
`Job2` = %d, \
`Paycheck` = %d, \
`HeadValue` = %d, \
`JailTime` = %d, \
`WRestricted` = %d, \
`Materials` = %d, \
`Crates` = %d, \
`Pot` = %d, \
`Crack` = %d, \
`Leader` = %d, \
`Member` = %d, \
`Division` = %d, \
`FMember` = %d,",
query,
PlayerInfo[playerid][pJob2],
PlayerInfo[playerid][pPayCheck],
PlayerInfo[playerid][pHeadValue],
PlayerInfo[playerid][pJailTime],
PlayerInfo[playerid][pWRestricted],
PlayerInfo[playerid][pMats],
PlayerInfo[playerid][pCrates],
PlayerInfo[playerid][pPot],
PlayerInfo[playerid][pCrack],
PlayerInfo[playerid][pLeader],
PlayerInfo[playerid][pMember],
PlayerInfo[playerid][pDivision],
PlayerInfo[playerid][pFMember]
);

format(query, sizeof(query), "%s \
`Rank` = %d, \
`DetSkill` = %d, \
`SexSkill` = %d, \
`BoxSkill` = %d, \
`LawSkill` = %d, \
`MechSkill` = %d, \
`TruckSkill` = %d, \
`DrugsSkill` = %d, \
`ArmsSkill` = %d, \
`SmugglerSkill` = %d, \
`FishSkill` = %d, \
`CheckCash` = %d,",
query,
PlayerInfo[playerid][pRank],
PlayerInfo[playerid][pDetSkill],
PlayerInfo[playerid][pSexSkill],
PlayerInfo[playerid][pBoxSkill],
PlayerInfo[playerid][pLawSkill],
PlayerInfo[playerid][pMechSkill],
PlayerInfo[playerid][pTruckSkill],
PlayerInfo[playerid][pDrugsSkill],
PlayerInfo[playerid][pArmsSkill],
PlayerInfo[playerid][pSmugSkill],
PlayerInfo[playerid][pFishSkill],
PlayerInfo[playerid][pCheckCash]
);

format(query, sizeof(query), "%s \
`Checks` = %d, \
`BoatLic` = %d, \
`FlyLic` = %d, \
`GunLic` = %d, \
`FishLic` = %d, \
`FishSkill` = %d, \
`FightingStyle` = %d, \
`PhoneNr` = %d, \
`Apartment` = %d, \
`Apartment2` = %d, \
`Renting` = %d, \
`CarLic` = %d \
WHERE `id` = '%d'",
query,
PlayerInfo[playerid][pChecks],
PlayerInfo[playerid][pBoatLic],
PlayerInfo[playerid][pFlyLic],
PlayerInfo[playerid][pGunLic],
PlayerInfo[playerid][pFishLic],
PlayerInfo[playerid][pFishSkill],
PlayerInfo[playerid][pFightStyle],
PlayerInfo[playerid][pPnumber],
PlayerInfo[playerid][pPhousekey],
PlayerInfo[playerid][pPhousekey2],
PlayerInfo[playerid][pRenting],
PlayerInfo[playerid][pCarLic],
GetPlayerSQLId(playerid)
);

mysql_function_query(MainPipeline, query, false, "OnQueryFinish", "ii", SENDDATA_THREAD, playerid);

format(query, sizeof(query), "UPDATE `accounts` SET \
`DrugsTime` = %d, \
`LawyerTime` = %d, \
`LawyerFreeTime` = %d, \
`MechTime` = %d, \
`SexTime` = %d, \
`PayDay` = %d, \
`PayDayHad` = %d, \
`CDPlayer` = %d, \
`Dice` = %d, \
`Spraycan` = %d, \
`Rope` = %d, \
`Cigars` = %d, \
`Sprunk` = %d, \
`Bombs` = %d, \
`Wins` = %d,",
PlayerInfo[playerid][pDrugsTime],
PlayerInfo[playerid][pLawyerTime],
PlayerInfo[playerid][pLawyerFreeTime],
PlayerInfo[playerid][pMechTime],
PlayerInfo[playerid][pSexTime],
PlayerInfo[playerid][pConnectSeconds],
PlayerInfo[playerid][pPayDayHad],
PlayerInfo[playerid][pCDPlayer],
PlayerInfo[playerid][pDice],
PlayerInfo[playerid][pSpraycan],
PlayerInfo[playerid][pRope],
PlayerInfo[playerid][pCigar],
PlayerInfo[playerid][pSprunk],
PlayerInfo[playerid][pBombs],
PlayerInfo[playerid][pWins]
);

for(new i = 0; i < 12; i++)
{
format(query, sizeof(query), "%s `Gun%d` = %d,", query, i, PlayerInfo[playerid][pGuns][i]);
}

format(query, sizeof(query), "%s \
`Loses` = %d, \
`Tutorial` = %d, \
`OnDuty` = %d, \
`Hospital` = %d, \
`Married` = %d, \
`MarriedTo` = '%s', \
`ContractBy` = '%s', \
`ContractDetail` = '%s', \
`WantedLevel` = %d, \
`Insurance` = %d, \
`NewMuted` = %d, \
`NewMutedTotal` = %d, \
`AdMuted` = %d, \
`911Muted` = %d, \
`AdMutedTotal` = %d,",
query,
PlayerInfo[playerid][pLoses],
PlayerInfo[playerid][pTut],
PlayerInfo[playerid][pDuty],
PlayerInfo[playerid][pHospital],
PlayerInfo[playerid][pMarriedID],
PlayerInfo[playerid][pMarriedName],
PlayerInfo[playerid][pContractBy],
g_mysql_ReturnEscaped(PlayerInfo[playerid][pContractDetail], MainPipeline),
PlayerInfo[playerid][pWantedLevel],
PlayerInfo[playerid][pInsurance],
PlayerInfo[playerid][pNMute],
PlayerInfo[playerid][pNMuteTotal],
PlayerInfo[playerid][pADMute],
PlayerInfo[playerid][p911Muted],
PlayerInfo[playerid][pADMuteTotal]
);

format(query, sizeof(query), "%s \
`HelpMute` = %d, \
`Helper` = %d, \
`ReportMuted` = %d, \
`ReportMutedTotal` = %d, \
`ReportMutedTime` = %d, \
`DMRMuted` = %d, \
`VIPMuted` = %d, \
`VIPMutedTime` = %d, \
`GiftTime` = %d, \
`AdvisorDutyHours` = %d, \
`AcceptedHelp` = %d, \
`AcceptReport` = %d, \
`TrashReport` = %d, \
`FactionModerator` = %d, \
`GangModerator` = %d, \
`GangWarn` = %d,",
query,
PlayerInfo[playerid][pHelpMute],
PlayerInfo[playerid][pHelper],
PlayerInfo[playerid][pRMuted],
PlayerInfo[playerid][pRMutedTotal],
PlayerInfo[playerid][pRMutedTime],
PlayerInfo[playerid][pDMRMuted],
PlayerInfo[playerid][pVMuted],
PlayerInfo[playerid][pVMutedTime],
PlayerInfo[playerid][pGiftTime],
PlayerInfo[playerid][pDutyHours],
PlayerInfo[playerid][pAcceptedHelp],
PlayerInfo[playerid][pAcceptReport],
PlayerInfo[playerid][pTrashReport],
PlayerInfo[playerid][pFactionModerator],
PlayerInfo[playerid][pGangModerator],
PlayerInfo[playerid][pGangWarn]
);

format(query, sizeof(query), "%s \
`CSFBanned` = %d, \
`VIPInviteDay` = %d, \
`TempVIP` = %d, \
`BuddyInvite` = %d, \
`Tokens` = %d, \
`PTokens` = %d, \
`TriageTime` = %d, \
`PrisonedBy` = '%s', \
`PrisonReason` = '%s', \
`TaxiLicense` = %d, \
`TicketTime` = %d, \
`Screwdriver` = %d, \
`Smslog` = %d, \
`Speedo` = %d \
WHERE `id` = '%d'",
query,
PlayerInfo[playerid][pCSFBanned],
PlayerInfo[playerid][pVIPInviteDay],
PlayerInfo[playerid][pTempVIP],
PlayerInfo[playerid][pBuddyInvited],
PlayerInfo[playerid][pTokens],
PlayerInfo[playerid][pPaintTokens],
PlayerInfo[playerid][pTriageTime],
PlayerInfo[playerid][pPrisonedBy],
g_mysql_ReturnEscaped(PlayerInfo[playerid][pPrisonReason], MainPipeline),
PlayerInfo[playerid][pTaxiLicense],
PlayerInfo[playerid][pTicketTime],
PlayerInfo[playerid][pScrewdriver],
PlayerInfo[playerid][pSmslog],
PlayerInfo[playerid][pSpeedo],
GetPlayerSQLId(playerid)
);

mysql_function_query(MainPipeline, query, false, "OnQueryFinish", "ii", SENDDATA_THREAD, playerid);

format(query, sizeof(query), "UPDATE `accounts` SET \
`Wristwatch` = %d, \
`Surveillance` = %d, \
`Tire` = %d, \
`Firstaid` = %d, \
`Rccam` = %d, \
`Receiver` = %d, \
`GPS` = %d, \
`Sweep` = %d, \
`SweepLeft` = %d, \
`Bugged` = %d,",
query,
PlayerInfo[playerid][pWristwatch],
PlayerInfo[playerid][pSurveillance],
PlayerInfo[playerid][pTire],
PlayerInfo[playerid][pFirstaid],
PlayerInfo[playerid][pRccam],
PlayerInfo[playerid][pReceiver],
PlayerInfo[playerid][pGPS],
PlayerInfo[playerid][pSweep],
PlayerInfo[playerid][pSweepLeft],
PlayerInfo[playerid][pBugged]
);

format(query, sizeof(query), "%s \
`pWExists` = %d, \
`pWSeeds` = %d, \
`Warrants` = %d, \
`JudgeJailTime` = %d, \
`JudgeJailType` = %d, \
`BeingSentenced` = %d, \
`ProbationTime` = %d, \
`DMKills` = %d,",
query,
PlayerInfo[playerid][pWeedObject],
PlayerInfo[playerid][pWSeeds],
PlayerInfo[playerid][pWarrant],
PlayerInfo[playerid][pJudgeJailTime],
PlayerInfo[playerid][pJudgeJailType],
PlayerInfo[playerid][pBeingSentenced],
PlayerInfo[playerid][pProbationTime],
PlayerInfo[playerid][pDMKills]
);

format(query, sizeof(query), "%s \
`OrderConfirmed` = %d, \
`FreezeHouse` = %d, \
`FreezeCar` = %d, \
`Firework` = %d, \
`Boombox` = %d, \
`Hydration` = %d, \
`DoubleEXP` = %d, \
`EXPToken` = %d, \
`RacePlayerLaps` = %d, \
`Ringtone` = %d,",
query,
PlayerInfo[playerid][pOrderConfirmed],
PlayerInfo[playerid][pFreezeHouse],
PlayerInfo[playerid][pFreezeCar],
PlayerInfo[playerid][pFirework],
PlayerInfo[playerid][pBoombox],
PlayerInfo[playerid][pHydration],
PlayerInfo[playerid][pDoubleEXP],
PlayerInfo[playerid][pEXPToken],
PlayerInfo[playerid][pRacePlayerLaps],
PlayerInfo[playerid][pRingtone]
);

format(query, sizeof(query), "%s \
`Order` = %d, \
`CallsAccepted` = %d, \
`PatientsDelivered` = %d, \
`LiveBanned` = %d, \
`FreezeBank` = %d, \
`VIPM` = %d, \
`VIPMO` = %d, \
`VIPExpire` = %d, \
`GVip` = %d, \
`Watchdog` = %d, \
`VIPSold` = %d, \
`GoldBoxTokens` = %d, \
`DrawChance` = %d, \
`RewardHours` = %.2f, \
`CarsRestricted` = %d, \
`LastCarWarning` = %d, \
`CarWarns` = %d, \
`Flagged` = %d \
WHERE `id` = '%d'",
query,
PlayerInfo[playerid][pOrder],
PlayerInfo[playerid][pCallsAccepted],
PlayerInfo[playerid][pPatientsDelivered],
PlayerInfo[playerid][pLiveBanned],
PlayerInfo[playerid][pFreezeBank],
PlayerInfo[playerid][pVIPM],
PlayerInfo[playerid][pVIPMO],
PlayerInfo[playerid][pVIPExpire],
PlayerInfo[playerid][pGVip],
PlayerInfo[playerid][pWatchdog],
PlayerInfo[playerid][pVIPSold],
PlayerInfo[playerid][pGoldBoxTokens],
PlayerInfo[playerid][pRewardDrawChance],
PlayerInfo[playerid][pRewardHours],
PlayerInfo[playerid][pRVehRestricted],
PlayerInfo[playerid][pLastRVehWarn],
PlayerInfo[playerid][pRVehWarns],
PlayerInfo[playerid][pFlagged],
GetPlayerSQLId(playerid)
);
mysql_function_query(MainPipeline, query, false, "OnQueryFinish", "ii", SENDDATA_THREAD, playerid);

format(query, sizeof(query), "%s \
`Hunger` = '%d', \
`HungerTimer` = '%d', \
`HungerDeathTimer` = '%d', \
`ForcePasswordChange` = '%d', \
`Fitness` = %d, \
`Credits` = %d, \
`HealthCare` = %d, \
`TotalCredits` = %d, \
`ReceivedCredits` = %d, \
`RimMod` = %d, \
`MailEnabled` = %d, \
`Paper` = %d, \
`Mailbox` = %d, \
`Business` = %d, \
`BusinessRank` = %d, \
`TreasureSkill` = %d, \
`MetalDetector` = %d, \
`HelpedBeforer` = %d,",
query,
PlayerInfo[playerid][pHunger],
PlayerInfo[playerid][pHungerTimer],
PlayerInfo[playerid][pHungerDeathTimer],
PlayerInfo[playerid][pForcePasswordChange],
PlayerInfo[playerid][pFitness],
PlayerInfo[playerid][pCredits],
PlayerInfo[playerid][pHealthCare],
PlayerInfo[playerid][pTotalCredits],
PlayerInfo[playerid][pReceivedCredits],
PlayerInfo[playerid][pRimMod],
PlayerInfo[playerid][pMailEnabled],
PlayerInfo[playerid][pPaper],
PlayerInfo[playerid][pMailbox],
PlayerInfo[playerid][pBusiness],
PlayerInfo[playerid][pBusinessRank],
PlayerInfo[playerid][pTreasureSkill],
PlayerInfo[playerid][pMetalDetector],
PlayerInfo[playerid][pHelpedBefore]
);

format(query, sizeof(query), "%s \
`Trickortreat` = %d, \
`LastCharmReceived` = %d, \
`RHMutes` = %d, \
`RHMuteTime` = %d, \
`GiftCode` = %d, \
`Table` = %d, \
`OpiumSeeds` = %d, \
`RawOpium` = %d, \
`Heroin` = %d, \
`Syringes` = %d, \
`Skins` = %d, \
`HasTazer` = %d, \
`HasCuff` = %d, \
`CarVoucher` = %d, \
`ReferredBy` = %s, \
`PendingRefReward` = %d, \
`Refers` = %d, \
`Famed` = %d,",
query,
PlayerInfo[playerid][pTrickortreat],
PlayerInfo[playerid][pLastCharmReceived],
PlayerInfo[playerid][pRHMutes],
PlayerInfo[playerid][pRHMuteTime],
PlayerInfo[playerid][pGiftCode],
PlayerInfo[playerid][pTable],
PlayerInfo[playerid][pOpiumSeeds],
PlayerInfo[playerid][pRawOpium],
PlayerInfo[playerid][pHeroin],
PlayerInfo[playerid][pSyringes],
PlayerInfo[playerid][pSkins],
PlayerInfo[playerid][pHasTazer],
PlayerInfo[playerid][pHasCuff],
PlayerInfo[playerid][pCarVoucher],
g_mysql_ReturnEscaped(PlayerInfo[playerid][pReferredBy], MainPipeline),
PlayerInfo[playerid][pPendingRefReward],
PlayerInfo[playerid][pRefers],
PlayerInfo[playerid][pFamed]
);

format(query, sizeof(query), "%s \
`FMuted` = %d, \
`DefendTime` = %d, \
`PVIPVoucher` = %d, \
`VehicleSlot` = %d, \
`ToySlot` = %d, \
`RFLTeam` = %d, \
`RFLTeamL` = %d, \
`VehVoucher` = %d, \
`SVIPVoucher` = %d, \
`GVIPVoucher` = %d, \
`GiftVoucher` = %d, \
`FallIntoFun` = %d, \
`HungerVoucher` = %d, \
`BoughtCure` = %d, \
`Vials` = %d, \
`AdvertVoucher` = %d, \
`ShopCounter` = %d, \
`ShopNotice` = %d, \
`SVIPExVoucher` = %d, \
`GVIPExVoucher` = %d, \
`VIPSellable` = %d, \
`ReceivedPrize` = %d, \
WHERE `id` = '%d'",
query,
PlayerInfo[playerid][pFMuted],
PlayerInfo[playerid][pDefendTime],
PlayerInfo[playerid][pPVIPVoucher],
PlayerInfo[playerid][pVehicleSlot],
PlayerInfo[playerid][pToySlot],
PlayerInfo[playerid][pRFLTeam],
PlayerInfo[playerid][pRFLTeamL],
PlayerInfo[playerid][pVehVoucher],
PlayerInfo[playerid][pSVIPVoucher],
PlayerInfo[playerid][pGVIPVoucher],
PlayerInfo[playerid][pGiftVoucher],
PlayerInfo[playerid][pFallIntoFun],
PlayerInfo[playerid][pHungerVoucher],
PlayerInfo[playerid][pBoughtCure],
PlayerInfo[playerid][pVials],
PlayerInfo[playerid][pAdvertVoucher],
PlayerInfo[playerid][pShopCounter],
PlayerInfo[playerid][pShopNotice],
PlayerInfo[playerid][pSVIPExVoucher],
PlayerInfo[playerid][pGVIPExVoucher],
PlayerInfo[playerid][pVIPSellable],
PlayerInfo[playerid][pReceivedPrize],
GetPlayerSQLId(playerid)
);

mysql_function_query(MainPipeline, query, false, "OnQueryFinish", "ii", SENDDATA_THREAD, playerid);
MySQLUpdateFinish(query, GetPlayerSQLId(playerid));
return 1;
}

Kenway
17/04/2014, 04:11 PM
Bump

Kenway
18/04/2014, 09:07 AM
bump

Kenway
18/04/2014, 11:44 AM
no help?

Conradus
18/04/2014, 11:59 AM
You included the query variable in while formatting the third query. It is not used here:
(it's at the 11th "format")

format(query, sizeof(query), "UPDATE `accounts` SET \
`Wristwatch` = %d, \
`Surveillance` = %d, \
`Tire` = %d, \
`Firstaid` = %d, \
`Rccam` = %d, \
`Receiver` = %d, \
`GPS` = %d, \
`Sweep` = %d, \
`SweepLeft` = %d, \
`Bugged` = %d,",
/*query,*/ // This line needs to be removed
PlayerInfo[playerid][pWristwatch],
PlayerInfo[playerid][pSurveillance],
PlayerInfo[playerid][pTire],
PlayerInfo[playerid][pFirstaid],
PlayerInfo[playerid][pRccam],
PlayerInfo[playerid][pReceiver],
PlayerInfo[playerid][pGPS],
PlayerInfo[playerid][pSweep],
PlayerInfo[playerid][pSweepLeft],
PlayerInfo[playerid][pBugged]
);