#1

I have a problem, when loading server statistics, it always null. No error in debug.txt. I am using BlueG r7 plugin.

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, "", "");
}
Loading:

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;
}
PMA:

Reply
#2

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.
Reply
#3

Quote:
Originally Posted by AndreT
Посмотреть сообщение
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.
What do you mean?

No, I want to load all fields. For the lenght, I will change it, ty
Reply
#4

up./
Reply
#5

le bump, really need this 2 fix
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)