SQL - GetAllClans / GetTotalMembers
#1

Hi guys! I have some problems with my script! when i type /clans ... just first clan is showed in dialog and said Members: 0
Please help me! REP ++;



pawn Код:
stock GetTotalMembers( clan[ ] )
{
    new membersquery[ 256 ];
    format( membersquery, 256, "SELECT `members` FROM `clans` WHERE `clanname` = '%s'", clan );
    Result = db_query( Database, membersquery );
    new rows = db_num_rows( Result );
    db_free_result( Result );
    return ( rows );
}
stock GetAllClans()
{
    new clanquery[1024];
    new minfo[1024];
    format(clanquery, sizeof(clanquery), "SELECT `clanname` FROM `clans`");
    Result = db_query( Database, clanquery );
    for(new i;i<db_num_rows(Result);i++)
    {
        new string[30];
        db_get_field_assoc(Result, "clanname", string, 30);
        format(minfo,sizeof(minfo),"%s\n"W"ClanName: "G"%s\t"O"|\t"YE"Members: "G"%d" ,minfo, string, GetTotalMembers(string));
        db_next_row(Result);
    }
    db_free_result(Result);
    return minfo;
}
Reply


Messages In This Thread
SQL - GetAllClans / GetTotalMembers - by nGen.SoNNy - 03.07.2012, 08:58
Re: SQL - GetAllClans / GetTotalMembers - by nGen.SoNNy - 03.07.2012, 09:13
Re: SQL - GetAllClans / GetTotalMembers - by nGen.SoNNy - 03.07.2012, 20:51
Respuesta: SQL - GetAllClans / GetTotalMembers - by [DOG]irinel1996 - 03.07.2012, 21:02
Re: SQL - GetAllClans / GetTotalMembers - by nGen.SoNNy - 03.07.2012, 21:09
Re: SQL - GetAllClans / GetTotalMembers - by [DOG]irinel1996 - 03.07.2012, 21:30

Forum Jump:


Users browsing this thread: 5 Guest(s)