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, "", "");
}
#define LoadStatistic() mysql_function_query(iHandle, "SELECT * FROM `statistika`", true, "OnServerStatisticLoad", "")
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;
}
Start off by showing what data you have in the table.
And as far as I can tell from your code, it only loads one row. Is that what you're trying to achieve? Also, please look into creating proper table structures with the right field sizes. I am no good at Lithuanian(?), but I can be quite sure that these values aren't up to 11 characters long. |