CS排名问题
如何实现,让MYSQL中score这列从大到小排序,并且找出比已知变量g_score大的行数g_ranknum,然后g_ranknum+1就是CS的排名了.这段代码怎么写,高手帮帮忙.g_dbc = dbi_connect(g_host,g_user,g_pass,g_dbname,g_error,MAX_NAME_LENGTH);
result = dbi_query(g_dbc,"select * from `%s` where Username = '%s'", g_sqlstats_table, g_name);
dbi_result(result, "score",g_score,10)
dbi_free_result(result)
dbi_close(g_dbc)
result = dbi_query(g_dbc,"SELECT COUNT(*) AS %s FROM `%s` WHERE score > g_score ", g_sqlstats_table, g_name);
我这样试了不成功啊
回复: CS排名问题
顶一下,学习下。...........回复: CS排名问题
select count(*)from admins a,admins b where a.score>b.score and b.auth='玩家名字';
参考下吧
回复: CS排名问题
select count(*) from tblauthor a,tblauthor b where a.score>b.score and b.Username='我的名字';可以成功的取得我的排名.可是在原码里我不会写啊,希望你还是给我写出来吧.先谢谢您了
页:
[1]