stock SaveBankAccounts() { new DB_Query[200]; for(new i= 1; i <= MAX_BANK_ACCOUNTS; i++) { if(bAccount[i][Used]) { mysql_format(Database, DB_Query, sizeof(DB_Query),"UPDATE `BANKACCOUNTS` SET `VALUE` = %d WHERE `ID` = %d LIMIT 1", bAccount[i][Value], i); mysql_tquery(Database, DB_Query); } } return 1; } stock SaveBusiness() { new DB_Query[1000]; for(new i; i < MAX_BUSINESS; i++) { if(Business[i][Used]) { mysql_format(Database, DB_Query, sizeof(DB_Query), "UPDATE `BUSINESS` SET `TYPE` = %d, `PRODUCT` = %d, `FEE` = %d, `SAFE` = %d, `VW` = %d, `INT` = %d, `IINT` = %d, `OWNER` = %d, `PRICE` = %d, `PosX` = %f, `PosY` = %f, `PosZ` = %f, `CpPosX` = %f, `CpPosY` = %f, `CpPosZ` = %f, `IPosX` = %f, `IPosY` = %f, `IPosZ` = %f WHERE `ID` = %d LIMIT 1", Business[i][Type],Business[i][Product],Business[i][Fee],Business[i][Safe],Business[i][Vw],Business[i][Int],Business[i][IInt],Business[i][Owner],Business[i][Price],Business[i][PosX],Business[i][PosY],Business[i][PosZ],Business[i][CpPosX],Business[i][CpPosY],Business[i][CpPosZ],Business[i][IPosX],Business[i][IPosY],Business[i][IPosZ],i); mysql_tquery(Database, DB_Query); } } return 1; }
SaveBusiness();
SaveBankAccounts();
for(new i= 1; i <= MAX_BANK_ACCOUNTS; i++)
stock SaveBankAccounts()
{
new query[256];
for(new i = 1; i < MAX_BANK_ACCOUNTS; i++)
{
if(bAccount[i][Used])
{
print("Is variable true test");
mysql_format(Database, query, sizeof(query), "UPDATE `BANKACCOUNTS` SET `VALUE`='%d' WHERE `ID`='%d' LIMIT 1", bAccount[i][Value], i);
mysql_query(Database, query);
}
}
}
EDIT: It should start from 1 because the the bankaccounts ID starts with 1 not 0
![]() |
Try this and if doesn't work, check your server log and see whether the message is printed.
PHP код:
You're right, my bad. Sorry about that. |
stock SaveBusiness()
{
new query[1000];
for(new i = 1; i < MAX_BUSINESS; i++)
{
if(Business[i][Used])
{
mysql_format(query, sizeof(query), "UPDATE `BUSINESS` SET `TYPE`='%d', `PRODUCT`= '%d',`FEE`= '%d', `SAFE`='%d', `VW`='%d', `INT`='%d',`IINT`='%d',`OWNER`='%d', `PRICE`='%d', `PosX`='%f', `PosY`='%f', `PosZ`='%f', `CpPosX`='%f',`CpPosY`='%f', `CpPosZ`= '%f', `IPosX`='%f', `IPosY`='%f',`IPosZ`='%f' WHERE `ID`='%d' LIMIT 1",
Business[i][Type],Business[i][Product],Business[i][Fee],Business[i][Safe],Business[i][Vw],Business[i][Int],Business[i][IInt],Business[i][Owner],Business[i][Price],Business[i][PosX],Business[i][PosY],Business[i][PosZ],Business[i][CpPosX],Business[i][CpPosY],Business[i][CpPosZ],Business[i][IPosX],Business[i][IPosY],Business[i][IPosZ],i);
mysql_query(Database, query);
}
}
}