12.06.2012, 12:46
I have a problem, when loading server statistics, it always null. No error in debug.txt. I am using BlueG r7 plugin.
Saving:
Loading:
PMA:
Saving:
pawn Код:
stock SaveStatistic()
{
new szQuery[289];
format(szQuery, 289, "UPDATE `statistika` SET `RekordoData` = '%s', `Saskaitos` = '%d', `Prisijungimai` = '%d', `Suimimai` = '%d', `Rekordas` = '%d', `DuotosBaudos` = '%d', `Ismetimai` = '%d', `Uzblokavimai` = '%d'",
sInfo[szRecordDate], sInfo[iAccounts], sInfo[iConnects], sInfo[iArrests], sInfo[iRecord], sInfo[iFines], sInfo[iKicks], sInfo[iBans]);
mysql_function_query(iHandle, szQuery, false, "", "");
}
pawn Код:
#define LoadStatistic() mysql_function_query(iHandle, "SELECT * FROM `statistika`", true, "OnServerStatisticLoad", "")
pawn Код:
PUB::OnServerStatisticLoad()
{
new
iFields,
iRows;
cache_get_data(iRows, iFields);
if (iRows)
{
new szResult[12];
cache_get_row(0, 0, sInfo[szRecordDate]);
cache_get_row(0, 1, szResult); sInfo[iAccounts] = strval(szResult);
cache_get_row(0, 2, szResult); sInfo[iConnects] = strval(szResult);
cache_get_row(0, 3, szResult); sInfo[iArrests] = strval(szResult);
cache_get_row(0, 4, szResult); sInfo[iRecord] = strval(szResult);
cache_get_row(0, 5, szResult); sInfo[iFines] = strval(szResult);
cache_get_row(0, 6, szResult); sInfo[iKicks] = strval(szResult);
cache_get_row(0, 7, szResult); sInfo[iBans] = strval(szResult);
}
return true;
}