Counting players MYSQL
#6

Quote:
Originally Posted by MadafakaPro
Посмотреть сообщение
Cant get `players` his code
I am trying to count all members from the faction but it doesnt works
pawn Код:
new query [ 124 ];
    format(query, sizeof(query), "SELECT Faction FROM players WHERE Faction = '%s'", PlayerInfo[playerid][playerteam]);
    mysql_query(query);
    mysql_store_result();
    new rows = mysql_num_rows();
    mysql_free_result();
and then iam using it like this
pawn Код:
format(iStr, sizeof(iStr), " F-Members: %d/%d", rows, dini_Int(tmpf,"fmemberslots"));
        SendClientMessage(playerid, COLOR_WHITE, iStr);
But its displaying 0 while there are more then 3 members.
Whats wrong here?
The query should be -
pawn Код:
SELECT * FROM `players` WHERE `Faction` = '%s'
As for the second problem, query size is insufficient. 47 characters for syntax plus 24 for player name and 1/2 for family ID - means, minimum size should be 73/74.
Reply


Messages In This Thread
Counting players MYSQL - by MadafakaPro - 13.01.2014, 11:43
Re: Counting players MYSQL - by iJumbo - 13.01.2014, 11:48
Re: Counting players MYSQL - by iBots - 13.01.2014, 12:26
Re: Counting players MYSQL - by MadafakaPro - 13.01.2014, 12:27
Re: Counting players MYSQL - by iJumbo - 13.01.2014, 12:44
Re: Counting players MYSQL - by RajatPawar - 14.01.2014, 04:05
Re: Counting players MYSQL - by Vince - 14.01.2014, 06:49

Forum Jump:


Users browsing this thread: 1 Guest(s)