20.02.2018, 20:50
I'm having trouble getting Player data to save in a gamemode I'm trying to edit, even though its using an old version of MySQL (R5) I cant figure out why it wont create players in the playerdata table when they /register.
Saving/loading houses works fine, but for some reason player data wont save.
Anybody have any ideas on how to fix this? I'm thinking its something minor I've missed as the house saving works fine
Ive been trying to solve this for days so would be very appreciative of any help or suggestions on how to solve it
When a player registers:
SavePlayerStats
HouseData (Saves and Loads fine):
playerdata table in SQL database:
Saving/loading houses works fine, but for some reason player data wont save.
Anybody have any ideas on how to fix this? I'm thinking its something minor I've missed as the house saving works fine
Ive been trying to solve this for days so would be very appreciative of any help or suggestions on how to solve it
When a player registers:
Код:
new string[256],query[256],escpass[256],PIP[56],LastLogin[128]; mysql_real_escape_string(inputtext, escpass); //mysql_real_escape_string(PlayerInfo[playerid][pName],PlayerInfo[playerid][pName]); //mysql_real_escape_string(inputtext,inputtext); format(query, sizeof(query), "INSERT INTO playerdata (UserName, Password, IP) VALUES('%s', SHA1('%s'), '%s')", PlayerInfo[playerid][pName], escpass, PIP); mysql_query(query); //format(query, sizeof(query), "INSERT INTO playerdata (UserName, Password, IP) VALUES ('%s', md5('%s'), '%s')",PlayerInfo[playerid][pName], inputtext, PIP); //Insert string //mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET Registered = '%s' WHERE (UserName = '%s')",LastLogin,PlayerInfo[playerid][pName]); mysql_query(query); //queries format(query,sizeof(query),"UPDATE playerdata SET LastLogin = '%s' WHERE (UserName = '%s')",LastLogin,PlayerInfo[playerid][pName]); mysql_query(query); //queries mysql_free_result(); PlayerInfo[playerid][pLogged] = 1; PlayerInfo[playerid][pRegistered] = 1; //SendClientMessage(playerid, COLOR_SERVER_MAIN_MSG, "Registered And Logged In."); SendClientMessage(playerid, COLOR_SERVER_MAIN_MSG, "New Account Created. Your Are Now Logged In. ");//Please Read The Registration Info. SendClientMessage(playerid, COLOR_SERVER_MAIN_MSG, "Type /help and /commands For Game Information, or visit "WEBSITE"");
Код:
stock SavePlayerStats(playerid) { if(!IsPlayerNPC(playerid) && PlayerInfo[playerid][pRegistered] == 1 && PlayerInfo[playerid][pLogged] == 1 && PlayerInfo[playerid][pSpawn] == 1) //Only saves if the player was logged in and spawned { new query[300],string[256],Float:Health,Float:Armour; if (PlayerInfo[playerid][pReturnWeapons] == 0) { for (new s=0; s<12; s++) { GetPlayerWeaponData(playerid, s, PlayerInfo[playerid][pWeapon][s],PlayerInfo[playerid][pAmmo][s]); } } PlayerInfo[playerid][pMoney] = GetPlayerMoney(playerid); PlayerInfo[playerid][pScore] = GetPlayerScore(playerid); GetPlayerHealth(playerid, Health); format(string, sizeof(string), "%d",floatround(Health)); PlayerInfo[playerid][pHealth] = strval(string); GetPlayerArmour(playerid, Armour); format(string, sizeof(string), "%d",floatround(Armour)); PlayerInfo[playerid][pArmour] = strval(string); format(query,sizeof(query),"UPDATE playerdata SET ConnHour = '%d' ,ConnMinute = '%d' ,ConnSecond = '%d' ,ConnTime = '%s',Tutorial = '%d',Regular = '%d',Donator = '%d',Score = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pConnHour],PlayerInfo[playerid][pConnMinute],PlayerInfo[playerid][pConnSecond],PlayerInfo[playerid][pConnTime],PlayerInfo[playerid][pTutorial],PlayerInfo[playerid][pRegular],PlayerInfo[playerid][pDonator],PlayerInfo[playerid][pScore],PlayerInfo[playerid][pName]); mysql_query(query); switch (CURRENT_GAMEMODE) { case LOS_SANTOS: { format(query,sizeof(query),"UPDATE playerdata SET LsResume = '%d',LsClass = '%d',LsTeam = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pResume],PlayerInfo[playerid][pClass],PlayerInfo[playerid][pTeam],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsSkill = '%d',LsLevel = '%d',LsRank = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pSkill],PlayerInfo[playerid][pLevel],PlayerInfo[playerid][pRank],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsMoney = '%d',LsHealth = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pMoney],PlayerInfo[playerid][pHealth],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsArmour = '%d',LsFakeSkill = '%d',LsGender = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pArmour],PlayerInfo[playerid][pFakeSkill],PlayerInfo[playerid][pGender],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsWeapon1 = '%d',LsAmmo1 = '%d',LsWeapon2 = '%d',LsAmmo2 = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pWeapon][1] ,PlayerInfo[playerid][pAmmo][1],PlayerInfo[playerid][pWeapon][2],PlayerInfo[playerid][pAmmo][2],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsWeapon3 = '%d',LsAmmo3 = '%d',LsWeapon4 = '%d',LsAmmo4 = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pWeapon][3] ,PlayerInfo[playerid][pAmmo][3],PlayerInfo[playerid][pWeapon][4],PlayerInfo[playerid][pAmmo][4],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsWeapon5 = '%d',LsAmmo5 = '%d',LsWeapon6 = '%d',LsAmmo6 = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pWeapon][5] ,PlayerInfo[playerid][pAmmo][5],PlayerInfo[playerid][pWeapon][6],PlayerInfo[playerid][pAmmo][6],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsWeapon7 = '%d',LsAmmo7 = '%d',LsWeapon8 = '%d',LsAmmo8 = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pWeapon][7] ,PlayerInfo[playerid][pAmmo][7],PlayerInfo[playerid][pWeapon][8],PlayerInfo[playerid][pAmmo][8],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsWeapon9 = '%d',LsAmmo9 = '%d',LsWeapon10 = '%d',LsAmmo10 = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pWeapon][9] ,PlayerInfo[playerid][pAmmo][9],PlayerInfo[playerid][pWeapon][10],PlayerInfo[playerid][pAmmo][10],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsWeapon11 = '%d',LsAmmo11 = '%d',LsWeapon12 = '%d',LsAmmo12 = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pWeapon][11] ,PlayerInfo[playerid][pAmmo][11],PlayerInfo[playerid][pWeapon][12],PlayerInfo[playerid][pAmmo][12],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsCondom = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pCondom],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsStd1 = '%d',LsStd2 = '%d',LsStd3 = '%d',LsStd4 = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pStd][1] ,PlayerInfo[playerid][pStd][2],PlayerInfo[playerid][pStd][3],PlayerInfo[playerid][pStd][4],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsChastity = '%d',LsFightStyle = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pChastity],PlayerInfo[playerid][pFightStyle],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsAdrenaline = '%d',LsEarnings = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pAdrenaline],PlayerInfo[playerid][pEarnings],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsBank = '%d',LsInterest = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pBank],PlayerInfo[playerid][pInterest],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsTaxes = '%d',LsDebt = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pTaxes],PlayerInfo[playerid][pDebt],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsLifeInsurance = '%d',LsHealthInsurance = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pLifeInsurance],PlayerInfo[playerid][pHealthInsurance],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsBankInsurance = '%d',LsWantedLevel = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pBankInsurance],PlayerInfo[playerid][pWantedLevel],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsDaysAlive = '%d',LsDrugs = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pDaysAlive],PlayerInfo[playerid][pDrugs],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsDeaths = '%d',LsKills = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pDeaths],PlayerInfo[playerid][pKills],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsHeals = '%d',LsHealed = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pHeals],PlayerInfo[playerid][pHealed],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsVehiclesStolen = '%d',LsVehiclesSold = '%d',LsCrimesCommitted = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pVehiclesStolen],PlayerInfo[playerid][pVehiclesSold],PlayerInfo[playerid][pCrimesCommitted],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsTicketsReceived = '%d',LsTicketsPaid = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pTicketsReceived],PlayerInfo[playerid][pTicketsPaid],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsTicketsIssued = '%d',LsTicketsCollected = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pTicketsIssued],PlayerInfo[playerid][pTicketsCollected],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsArrested = '%d',LsReported = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pArrested],PlayerInfo[playerid][pReported],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsArrests = '%d',LsReports = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pArrests],PlayerInfo[playerid][pReports],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsHitsReceived = '%d',LsHitsPlaced = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pHitsReceived],PlayerInfo[playerid][pHitsPlaced],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsRapes = '%d',LsRaped = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pRapes],PlayerInfo[playerid][pRaped],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsRobberies = '%d',LsRobbed = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pRobberies],PlayerInfo[playerid][pRobbed],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsBail = '%d',LsJailVisits = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pBail],PlayerInfo[playerid][pJailVisits],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsJailed = '%d',LsJailHour = '%d',LsJailMinute = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pJailed],PlayerInfo[playerid][pJailHour],PlayerInfo[playerid][pJailMinute],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsHouse = '%d',LsCar = '%d',LsGunLic = '%d' WHERE UserName = '%s'",PlayerInfo[playerid][pHouse],PlayerInfo[playerid][pCar],PlayerInfo[playerid][pGunLic],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsMenu_Items = '%d' WHERE UserName = '%s'",Menu_Items[playerid],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsMenu_ItemName1 = '%s',LsMenu_ItemName2 = '%s',LsMenu_ItemName3 = '%s',LsMenu_ItemName4 = '%s',LsMenu_ItemName5 = '%s' WHERE UserName = '%s'",Menu_ItemName[playerid][1],Menu_ItemName[playerid][2],Menu_ItemName[playerid][3],Menu_ItemName[playerid][4],Menu_ItemName[playerid][5],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsMenu_ItemName6 = '%s',LsMenu_ItemName7 = '%s',LsMenu_ItemName8 = '%s',LsMenu_ItemName9 = '%s',LsMenu_ItemName10 = '%s' WHERE UserName = '%s'",Menu_ItemName[playerid][6],Menu_ItemName[playerid][7],Menu_ItemName[playerid][8],Menu_ItemName[playerid][9],Menu_ItemName[playerid][10],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsMenu_ItemPrice1 = '%d',LsMenu_ItemPrice2 = '%d',LsMenu_ItemPrice3 = '%d',LsMenu_ItemPrice4 = '%d',LsMenu_ItemPrice5 = '%d' WHERE UserName = '%s'",Menu_ItemPrice[playerid][1],Menu_ItemPrice[playerid][2],Menu_ItemPrice[playerid][3],Menu_ItemPrice[playerid][4],Menu_ItemPrice[playerid][5],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsMenu_ItemPrice6 = '%d',LsMenu_ItemPrice7 = '%d',LsMenu_ItemPrice8 = '%d',LsMenu_ItemPrice9 = '%d',LsMenu_ItemPrice10 = '%d' WHERE UserName = '%s'",Menu_ItemPrice[playerid][6],Menu_ItemPrice[playerid][7],Menu_ItemPrice[playerid][8],Menu_ItemPrice[playerid][9],Menu_ItemPrice[playerid][10],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsMenu_ItemMinPrice1 = '%d',LsMenu_ItemMinPrice2 = '%d',LsMenu_ItemMinPrice3 = '%d',LsMenu_ItemMinPrice4 = '%d',LsMenu_ItemMinPrice5 = '%d' WHERE UserName = '%s'",Menu_ItemMinPrice[playerid][1],Menu_ItemMinPrice[playerid][2],Menu_ItemMinPrice[playerid][3],Menu_ItemMinPrice[playerid][4],Menu_ItemMinPrice[playerid][5],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsMenu_ItemMinPrice6 = '%d',LsMenu_ItemMinPrice7 = '%d',LsMenu_ItemMinPrice8 = '%d',LsMenu_ItemMinPrice9 = '%d',LsMenu_ItemMinPrice10 = '%d' WHERE UserName = '%s'",Menu_ItemMinPrice[playerid][6],Menu_ItemMinPrice[playerid][7],Menu_ItemMinPrice[playerid][8],Menu_ItemMinPrice[playerid][9],Menu_ItemMinPrice[playerid][10],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsMenu_ItemMaxPrice1 = '%d',LsMenu_ItemMaxPrice2 = '%d',LsMenu_ItemMaxPrice3 = '%d',LsMenu_ItemMaxPrice4 = '%d',LsMenu_ItemMaxPrice5 = '%d' WHERE UserName = '%s'",Menu_ItemMaxPrice[playerid][1],Menu_ItemMaxPrice[playerid][2],Menu_ItemMaxPrice[playerid][3],Menu_ItemMaxPrice[playerid][4],Menu_ItemMaxPrice[playerid][5],PlayerInfo[playerid][pName]); mysql_query(query); format(query,sizeof(query),"UPDATE playerdata SET LsMenu_ItemMaxPrice6 = '%d',LsMenu_ItemMaxPrice7 = '%d',LsMenu_ItemMaxPrice8 = '%d',LsMenu_ItemMaxPrice9 = '%d',LsMenu_ItemMaxPrice10 = '%d' WHERE UserName = '%s'",Menu_ItemMaxPrice[playerid][6],Menu_ItemMaxPrice[playerid][7],Menu_ItemMaxPrice[playerid][8],Menu_ItemMaxPrice[playerid][9],Menu_ItemMaxPrice[playerid][10],PlayerInfo[playerid][pName]); mysql_query(query); } mysql_free_result(); //Frees the result } }
Код:
stock SaveProperty(Houseid) { new query[300]; switch (CURRENT_GAMEMODE) { case LOS_SANTOS: { format(query, sizeof(query), "SELECT * FROM lshousedata WHERE Houseid = '%d'", Houseid); mysql_query(query); //Queries the result mysql_store_result(); //Store a result because it's a SELECT statement. if(mysql_num_rows() == 0) //If the houseid is not found { if (CREATE_PLAYER_DATABASE == 1) { format(query, sizeof(query), "INSERT INTO lshousedata (Houseid) VALUES ('%d')",Houseid); //Insert string mysql_query(query); }else{ mysql_query("ALTER TABLE lshousedata ADD OwnerName VARCHAR(128) NOT NULL default 'The Bank'"); mysql_query("ALTER TABLE lshousedata ADD OwnerID INT(11) NOT NULL default -1"); mysql_query("ALTER TABLE lshousedata ADD RenterName VARCHAR(128) NOT NULL default 'None'"); mysql_query("ALTER TABLE lshousedata ADD RenterID INT(11) NOT NULL default -1"); mysql_query("ALTER TABLE lshousedata ADD HouseName VARCHAR(128) NOT NULL default 'House'"); mysql_query("ALTER TABLE lshousedata ADD Value INT(11) NOT NULL default 200000"); mysql_query("ALTER TABLE lshousedata ADD Rent INT(11) NOT NULL default 0"); mysql_query("ALTER TABLE lshousedata ADD ForSale INT(11) NOT NULL default 0"); mysql_query("ALTER TABLE lshousedata ADD Alarm INT(11) NOT NULL default 0"); mysql_query("ALTER TABLE lshousedata ADD Lock INT(11) NOT NULL default 0"); mysql_query("ALTER TABLE lshousedata ADD Money INT(11) NOT NULL default 0"); mysql_query("ALTER TABLE lshousedata ADD Drugs INT(11) NOT NULL default 0"); mysql_query("ALTER TABLE lshousedata ADD Condoms INT(11) NOT NULL default 0"); mysql_query("ALTER TABLE lshousedata ADD Flowers INT(11) NOT NULL default 0"); mysql_query("ALTER TABLE lshousedata ADD Robberies INT(11) NOT NULL default 0"); mysql_query("ALTER TABLE lshousedata ADD Breakins INT(11) NOT NULL default 0"); mysql_query("ALTER TABLE lshousedata ADD OwnerVisits INT(11) NOT NULL default 0"); mysql_query("ALTER TABLE lshousedata ADD OtherVisits INT(11) NOT NULL default 0"); mysql_query("ALTER TABLE lshousedata ADD Purchasers INT(11) NOT NULL default 0"); mysql_query("ALTER TABLE lshousedata ADD Rented INT(11) NOT NULL default 0"); } }else{ format(query, sizeof(query), "UPDATE lshousedata SET OwnerName = '%s' WHERE Houseid = '%d'",HouseData[Houseid][h_OwnerName],Houseid); mysql_query(query); format(query, sizeof(query), "UPDATE lshousedata SET OwnerID = '%d' WHERE Houseid = '%d'",HouseData[Houseid][h_OwnerID],Houseid); mysql_query(query); format(query, sizeof(query), "UPDATE lshousedata SET RenterName = '%s' WHERE Houseid = '%d'",HouseData[Houseid][h_RenterName],Houseid); mysql_query(query); format(query, sizeof(query), "UPDATE lshousedata SET RenterID = '%d' WHERE Houseid = '%d'",HouseData[Houseid][h_RenterID],Houseid); mysql_query(query); format(query, sizeof(query), "UPDATE lshousedata SET HouseName = '%s' WHERE Houseid = '%s'",HouseInfo[Houseid][h_HouseIntName],Houseid); mysql_query(query); format(query, sizeof(query), "UPDATE lshousedata SET Value = '%d' WHERE Houseid = '%d'",HouseData[Houseid][h_Value],Houseid); mysql_query(query); format(query, sizeof(query), "UPDATE lshousedata SET Rent = '%d' WHERE Houseid = '%d'",HouseData[Houseid][h_Rent],Houseid); mysql_query(query); format(query, sizeof(query), "UPDATE lshousedata SET ForSale = '%d' WHERE Houseid = '%d'",HouseData[Houseid][h_ForSale],Houseid); mysql_query(query); format(query, sizeof(query), "UPDATE lshousedata SET Alarm = '%d' WHERE Houseid = '%d'",HouseData[Houseid][h_Alarm],Houseid); mysql_query(query); format(query, sizeof(query), "UPDATE lshousedata SET Lock = '%d' WHERE Houseid = '%d'",HouseData[Houseid][h_Lock],Houseid); mysql_query(query); format(query, sizeof(query), "UPDATE lshousedata SET Money = '%d' WHERE Houseid = '%d'",HouseData[Houseid][h_Money],Houseid); mysql_query(query); format(query, sizeof(query), "UPDATE lshousedata SET Drugs = '%d' WHERE Houseid = '%d'",HouseData[Houseid][h_Drugs],Houseid); mysql_query(query); format(query, sizeof(query), "UPDATE lshousedata SET Condoms = '%d' WHERE Houseid = '%d'",HouseData[Houseid][h_Condoms],Houseid); mysql_query(query); format(query, sizeof(query), "UPDATE lshousedata SET Flowers = '%d' WHERE Houseid = '%d'",HouseData[Houseid][h_Flowers],Houseid); mysql_query(query); format(query, sizeof(query), "UPDATE lshousedata SET Robberies = '%d' WHERE Houseid = '%d'",HouseData[Houseid][h_Robberies],Houseid); mysql_query(query); format(query, sizeof(query), "UPDATE lshousedata SET Breakins = '%d' WHERE Houseid = '%d'",HouseData[Houseid][h_Breakins],Houseid); mysql_query(query); format(query, sizeof(query), "UPDATE lshousedata SET OwnerVisits = '%d' WHERE Houseid = '%d'",HouseData[Houseid][h_OwnerVisits],Houseid); mysql_query(query); format(query, sizeof(query), "UPDATE lshousedata SET OtherVisits = '%d' WHERE Houseid = '%d'",HouseData[Houseid][h_OtherVisits],Houseid); mysql_query(query); format(query, sizeof(query), "UPDATE lshousedata SET Purchasers = '%d' WHERE Houseid = '%d'",HouseData[Houseid][h_Purchasers],Houseid); mysql_query(query); format(query, sizeof(query), "UPDATE lshousedata SET Rented = '%d' WHERE Houseid = '%d'",HouseData[Houseid][h_Rented],Houseid); mysql_query(query); } }