/top10 with mysql.
#2

Lets just say that we are doing the top 10 players by score. Your variables are probably not going to be like the following but it's a example

pawn Code:
mysql_query("SELECT score, username FROM usertable ORDER BY score DESC LIMIT 10");
mysql_store_result();
new id;
while(mysql_retrieve_row())
{
    id ++;
    new username[24], scorevariable[5];
    mysql_fetch_field_row(username, "username");
    mysql_fetch_field_row(scorevariable, "score");
    printf("Position %d: Username - %s | Score: %d", id, username, strval(scorevariable));
}
mysql_free_result();
Reply


Messages In This Thread
/top10 with mysql. - by budelis - 09.09.2011, 11:16
Re: /top10 with mysql. - by [HiC]TheKiller - 09.09.2011, 12:14
[No subject] - by budelis - 10.09.2011, 07:55
Re: /top10 with mysql. - by Vince - 10.09.2011, 10:39
Re: /top10 with mysql. - by budelis - 10.09.2011, 12:09
Re: /top10 with mysql. - by [HiC]TheKiller - 10.09.2011, 12:26
Re: /top10 with mysql. - by Gh0sT_ - 10.09.2011, 12:30
[No subject] - by budelis - 10.09.2011, 13:25

Forum Jump:


Users browsing this thread: 1 Guest(s)