22.07.2014, 13:39
Загружает нормально:
Но не сохраняет. Ошибок в логе нету
PHP код:
public LoadFarmCallback()
{
new rows, fields;
cache_get_data(rows, fields);
if(rows > 0)
{
for(new t = 0; t < rows; t++)//цикл всех
{
if(t == 0)
{
AppleFarm[1][Bank] = cache_get_row_int(t, 1);
AppleFarm[1][AppleCost] = cache_get_row_int(t, 2);
AppleFarm[1][WorkCost] = cache_get_row_int(t, 3);
AppleFarm[1][AppleDobr] = cache_get_row_int(t, 4);
AppleFarm[1][AppleProduct] = cache_get_row_int(t, 5);
AppleFarm[1][AppleMaterial] = cache_get_row_int(t, 6);
cache_get_field_content(t, "Owner", AppleFarm[1][Owner], Connection);
printf("%d",AppleFarm[1][Bank]);
printf("%s",AppleFarm[1][Owner]);
AppleFarm[1][Bank] = 228;
printf("%d",AppleFarm[1][Bank]);
}
}
}
}
PHP код:
public SaveFarmCallback()
{
new query[512];
mysql_format(Connection, query, sizeof(query),"UPDATE `farms` SET `Bank` = '%d', `ProductCost` = '%d', `WorkCost` = '%d', `Dobr` = '%d', `Product` = '%d', `Material` = '%d', `Owner` = '%s' WHERE `id`=1",
AppleFarm[1][Bank],
AppleFarm[1][AppleCost],
AppleFarm[1][WorkCost],
AppleFarm[1][AppleDobr],
AppleFarm[1][AppleProduct],
AppleFarm[1][AppleMaterial],
AppleFarm[1][Owner]);
mysql_function_query(Connection, query, false, "", "");
printf("%s",query);
return true;
}