- SELECT COUNT(`uid`) as aa FROM `cdb_members` WHERE `extcredits2`+`extcredits3` > (SELECT `extcredits2`+`extcredits3` FROM `cdb_members` WHERE `username` = '$name')
- $sql03="SELECT COUNT(`uid`) as aa FROM `cdb_members` WHERE `extcredits2`+`extcredits3` > (SELECT `extcredits2`+`extcredits3` FROM `cdb_members` WHERE `username` = '$name')";
- $query03=mysql_query($sql03,$conn);
- $row03=mysql_fetch_array($query03);
- $ranking=$row[aa]+1;
记得加1
本文转自许琴 51CTO博客,原文链接:http://blog.51cto.com/xuqin/924598,如需转载请自行联系原作者