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
#2

Nobody can help me?
Reply
#3

UP
Reply
#4

Use a loop to check all tables, and mysql_num_rows to get the number of fields.
Reply
#5

I;m using SQL
If you can edit my script i will rep++ and many thx
Reply
#6

Well.. I'm in my mobile phone right now, give me 30 minutes.
Romanian, hehe...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)