Getting the number of rows using Blue G's MySQL
#2

Abagail's right, you're returning one anyways.

I would do it like this
pawn Код:
CMD:factions(playerid, params[])
{
    new str[128];
    for(new f; f < MAX_FACTIONS; f++)
    {
        if(FactionInfo[f][FactionType] != 0)
        {
            new query[200];
            mysql_format(con, query, sizeof(query), "SELECT * FROM `players` WHERE `faction` = '%d'", factionid);
            mysql_tquery(con, query, "GetFactionMembers", "ii", playerid, factionid);
        }
    }
    return 1;
}

stock GetFactionMembers(playerid, factionid)
{
    format(str, 128, "[FID: %d] Name: %s | Members: %d", f, FactionInfo[f][FactionName], cache_get_row_count());
    SendClientMessage(playerid, -1, str);
    return 1;
}
Reply


Messages In This Thread
Getting the number of rows using Blue G's MySQL - by 2KY - 07.08.2015, 03:33
Re: Getting the number of rows using Blue G's MySQL - by xVIP3Rx - 07.08.2015, 04:25
Re: Getting the number of rows using Blue G's MySQL - by Abagail - 07.08.2015, 04:28

Forum Jump:


Users browsing this thread: 1 Guest(s)