MySQL
#1

As I rewrited MySQL from R6-2 to R7, I got a problem now with TOP10. For example, there is one registered player with name ABC with 100$, so the TOP10 should look like this:

Quote:

1. ABC ($100)
2. There is no registered player
3. There is no registered player
4. There is no registered player
5. There is no registered player
6. There is no registered player
7. There is no registered player
8. There is no registered player
9. There is no registered player
10. There is no registered player

But the problem is that the TOP looks like this:

Quote:

1. ABC ($100)
2. ABC ($100)
3. ABC ($100)
4. ABC ($100)
5. ABC ($100)
6. ABC ($100)
7. ABC ($100)
8. ABC ($100)
9. ABC ($100)
10. ABC ($100)

The code:

pawn Код:
PUB::GetStatistic(playerid, Field[], Command[], bool: toStrval)
{
    new szQuery[88];
    format(szQuery, 87, "SELECT `Name`, `%s` FROM `players` ORDER BY `%s` %s LIMIT 10", Field, Field, Command);
    mysql_function_query(iHandle, szQuery, true, "GetServerStatistic", "dssdd", playerid, Field, Command, Item, toStrval);
}

pawn Код:
PUB::GetServerStatistic(playerid, Field[], Command[], bool: toStrval)
{
    new
        szResult[1100],
        szField [21],
        pName   [24],
        iFields,
        iRows;
       
    >>>>>>>>>for (new i; i != 10; ++i)
    {
        cache_get_data(iRows, iFields);
        if (iRows)
        {
            cache_get_row(0, 0, pName);
            cache_get_row(0, 1, szField);
            if (toStrval)
            {
                format(szResult, 1100, "%s{FF0000}%d. {33AA33}%s ({FF0000}%d{33AA33})\n", szResult, i + 1, pName, strval(szField));
            }
            else
            {
                format(szResult, 1100, "%s{FF0000}%d. {33AA33}%s ({FF0000}%s{33AA33})\n", szResult, i + 1, pName, szField);
            }
        }<<<<<<<<<<<<
        else
        {
            format(szResult, 1100, "%s{FF0000}%d. {33AA33}Nлra\n", szResult, i + 1);
        }
    }
          ........
I think the problem is where I put >><<, but I dont know, how to fix it.

Any solutions? Thx.
Reply


Messages In This Thread
MySQL - by AnonymousUser - 29.06.2012, 17:52
Re: MySQL - by Vince - 29.06.2012, 18:25
Re: MySQL - by AnonymousUser - 29.06.2012, 18:38
Re: MySQL - by Vince - 29.06.2012, 19:15
Re: MySQL - by AnonymousUser - 29.06.2012, 21:01
Re: MySQL - by AnonymousUser - 30.06.2012, 20:11
Re: MySQL - by AndreT - 30.06.2012, 20:36
Re: MySQL - by Pizzy - 30.06.2012, 20:43
Re: MySQL - by BaubaS - 30.06.2012, 22:17
Re: MySQL - by AndreT - 30.06.2012, 23:57

Forum Jump:


Users browsing this thread: 3 Guest(s)