UpdateHouses() { RefreshMySQL(); new string[512]; for(new i; i < MAX_HOUSES; i++) { format(string, sizeof(string), "UPDATE `houses` SET hDiscription='%s', hEnterX='%.4f', hEnterY='%.4f', hEnterZ='%.4f', hExitX='%.4f' WHERE hID=%d", HouseInfo[i][hDiscription], HouseInfo[i][hEnterX], HouseInfo[i][hEnterY], HouseInfo[i][hEnterZ], HouseInfo[i][hExitX], HouseInfo[i][hID]); mysql_query(string); format(string, sizeof(string), "UPDATE `houses` SET hExitY='%.4f', hExitZ='%.4f', hVecPosX='%.4f', hVecPosY='%.4f', hVecPosZ='%.4f' WHERE hID=%d", HouseInfo[i][hExitY], HouseInfo[i][hExitZ], HouseInfo[i][hVecPosX], HouseInfo[i][hVecPosY], HouseInfo[i][hVecPosZ], HouseInfo[i][hID]); mysql_query(string); format(string, sizeof(string), "UPDATE `houses` SET hVecColor1='%d', hVecColor2='%d', hInt='%d', hVir='%d', hPrice='%d' WHERE hID=%d", HouseInfo[i][hVecColor1], HouseInfo[i][hVecColor2], HouseInfo[i][hInt], HouseInfo[i][hVir], HouseInfo[i][hPrice] , HouseInfo[i][hID]); mysql_query(string); format(string, sizeof(string), "UPDATE `houses` SET hOwned='%d', hOwner='%s', hLocked='%d' WHERE hID=%d", HouseInfo[i][hOwned], HouseInfo[i][hOwner], HouseInfo[i][hLocked], HouseInfo[i][hID]); mysql_query(string); } mysql_free_result(); }
I didn't spend a lot of time revising your code as it's just too little to understand the way you're getting you system to work. However, are you sure you have everything correct in the MySQL database? If you have defined the default values, it could cause a problem...
|