SA-MP Forums Archive
MySQL - DESC limit ?? - Help! - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: MySQL - DESC limit ?? - Help! (/showthread.php?tid=341867)



MySQL - DESC limit ?? - Help! - nGen.SoNNy - 12.05.2012

What's wronk on this MySQL function...? I just to show just 15 playername from that table! Help REP++;

pawn Код:
stock GetClanMembers(clan[])
{
    new clanquery[200];
    new minfo[512];
    new string[512];
    format(clanquery, sizeof(clanquery), "SELECT * FROM members ORDER BY (isinclan) DESC limit 15 WHERE clanname = '%s'", clan);
    //format(clanquery, sizeof(clanquery), "SELECT * FROM members WHERE clanname = '%s'", clan);
    mysql_query(clanquery);
    mysql_store_result();
    while(mysql_fetch_row_format(clanquery,"|"))
    {
        mysql_fetch_field_row(string,"playername");
        format(minfo,sizeof(minfo),"%s\n"W"Name: "G"%s",minfo, string);
    }
    mysql_free_result();
    return minfo;
}



Re: MySQL - DESC limit ?? - Help! - [HiC]TheKiller - 12.05.2012

pawn Код:
format(clanquery, sizeof(clanquery), "SELECT * FROM members WHERE clanname = '%s' ORDER BY isinclan DESC LIMIT 15 ", clan);
Give that a go.


Re: MySQL - DESC limit ?? - Help! - nGen.SoNNy - 12.05.2012

Thx BRO:X [HiC]TheKiller = REP++; )