我的 TOP LIST 有这条鳕鱼
$pos=0;
$upit = mysql_query("SELECT * FROM wp_entries ORDER BY vote DESC");
while ($sms = mysql_fetch_array($upit)) {
$pos++;
$data = unserialize($sms['data']);
echo " ".$pos." ".$data[1]['value']." ".$data[2]['value']." ".$sms[vote]." ";
}
数据[1] 是 NAME
数据[2] 是姓氏
sms[vote] 是 NUMBER OF VOTES
这些顶级列表看起来像这样
1 Novak Djokovic 50
2 Rafael Nadal 35
3 Roger Federer 30
4 Andre Agassi 26
5 Pete Sampras 22
6 Andy Murray 19
7 Chris Evert 13
8 Michael Chang 10
9 Andy Roddick 7
10 Boris Becker 5
11 Björn Borg 1
我希望我的顶级列表看起来像这样
// FINALIST // Limit first 4 // green font 1 Novak Djokovic 50 2 Rafael Nadal 35 3 Roger Federer 30 4 Andre Agassi 26 // OTHERS // All other except first 4 and last 2 // black font 5 Pete Sampras 22 6 Andy Murray 19 7 Chris Evert 13 8 Michael Chang 10 9 Andy Roddick 7 // FALL OUT // Limit last 2 // red font 10 Boris Becker 5 11 Björn Borg 1
我希望你能理解我,并且有人知道如何解决这个问题。谢谢你。