MySQL get rows problem
#1

pawn Code:
stock GetClanMembers(clan[])
{
    new minfo[3*550], mreturn[386], string[386], clanquery[160], count;
    format(clanquery, sizeof(clanquery), "SELECT * FROM members WHERE clanname = '%s'", clan);
    mysql_query(1,clanquery);
    mysql_store_result();
    while(mysql_fetch_row_format(clanquery,"|"))
    {
        count++;
        mysql_fetch_field_row(string,"playername");
        format(minfo,sizeof(minfo),"{FA5882}%i. {FFFF90}Name: {375FFF}%s {FFFF90}Rank: {375FFF}%s (%i) {FFFFFF}Stats: %s\n",count, string, GetClanRankName(clan, GetPlayerClanRankEx(string)),GetPlayerClanRankEx(string), (!IsPlayerOnline(string)?("{00FF00}Online"):("{FF0000}Offline")) );
        strcat(mreturn, minfo);
    }
    mysql_free_result();
    return mreturn;
}

CMD:cmembers(playerid, params[])
{
    LoginCheck(playerid);
    if(IsPlayerAnyClanMember(playerid))
    {
    Dialog_Show(playerid, DialogUnused, DIALOG_STYLE_MSGBOX, "Afrade Clan", "{FA5882}%s", "Ok","" ,GetClanMembers(GetPlayerClan(playerid)));
    } else return Error(playerid, "Dastersi Nadarid.");
    return true;
}
Problem:
Just get one row and show on the dialog.
How to fix this??
Reply
#2

Change

PHP Code:
format(minfo,sizeof(minfo),"{FA5882}%i. {FFFF90}Name: {375FFF}%s {FFFF90}Rank: {375FFF}%s (%i) {FFFFFF}Stats: %s\n",countstringGetClanRankName(clanGetPlayerClanRankEx(string)),GetPlayerClanRankEx(string), (!IsPlayerOnline(string)?("{00FF00}Online"):("{FF0000}Offline")) ); 
to

PHP Code:
format(minfo,sizeof(minfo),"%s\n{FA5882}%i. {FFFF90}Name: {375FFF}%s {FFFF90}Rank: {375FFF}%s (%i) {FFFFFF}Stats: %s\n",minfocountstringGetClanRankName(clanGetPlayerClanRankEx(string)),GetPlayerClanRankEx(string), (!IsPlayerOnline(string)?("{00FF00}Online"):("{FF0000}Offline")) ); 
Reply
#3

Quote:
Originally Posted by NoteND
View Post
Change

PHP Code:
format(minfo,sizeof(minfo),"{FA5882}%i. {FFFF90}Name: {375FFF}%s {FFFF90}Rank: {375FFF}%s (%i) {FFFFFF}Stats: %s\n",countstringGetClanRankName(clanGetPlayerClanRankEx(string)),GetPlayerClanRankEx(string), (!IsPlayerOnline(string)?("{00FF00}Online"):("{FF0000}Offline")) ); 
to

PHP Code:
format(minfo,sizeof(minfo),"%s\n{FA5882}%i. {FFFF90}Name: {375FFF}%s {FFFF90}Rank: {375FFF}%s (%i) {FFFFFF}Stats: %s\n",minfocountstringGetClanRankName(clanGetPlayerClanRankEx(string)),GetPlayerClanRankEx(string), (!IsPlayerOnline(string)?("{00FF00}Online"):("{FF0000}Offline")) ); 
not working..
Still get one row.
Reply
#4

bump

EDIT:
I find problem:
Code:
stock GetPlayerClanRankEx(playername[])
{
	new rank[10];
	new clanquery[100];
	format(clanquery, sizeof(clanquery), "SELECT playerclanrank FROM members WHERE playername = '%s'", playername);
	mysql_query(1,clanquery);
	mysql_store_result();
	mysql_fetch_row(rank);
	mysql_free_result();
	return strval(rank);
}
How to fix ?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)