PHP排名系统出错

时间:2016-10-28 00:23:16

标签: php

我的排名系统出错了,当代表达到合适的级别时,它不会自动更新。有关详细信息,请参见下文。

这是排名系统的开始。这就是我认为问题所在。我自己看不到问题,因为它正在工作,有人搞砸了并编辑了一些东西。我试图找到问题的位置多次,我发现了一些图形错误,但没有使用影响db或游戏的php编码。 我知道我正在使用mysql并且它不再受支持但我没有创建它们我只是编辑它们,我将很快将所有内容更新到mysqli。

    $currank = $fetch->rank;
    $rankp = $fetch->rep;

if ($currank == "New Generation"){
    $max = "75000";
    $old="0";

}elseif ($currank == "Boy/Girl Racer"){
    $max = '200000';
    $old="75000";

}elseif ($currank == "Speeder"){
    $max = '500000';
    $old="200000";

}elseif ($currank == "Skilled Racer"){
    $max = '1000000';
    $old = "500000";

}elseif ($currank == "Street Racer"){
    $max = '2500000';
    $old="1000000";

}elseif ($currank == "Respected Racer"){
    $max = '7500000';
    $old="2500000";

            }elseif ($currank == "Amateur Racer"){
    $max = '10000000';
    $old="7500000";

}elseif ($currank == "Pro Racer"){
    $max = '20000000';
    $old="10000000";

}elseif ($currank == "Wanted Racer"){
    $max = '40000000';
    $old="20000000";

}elseif ($currank == "Most Wanted Racer"){
    $max = '60000000';
    $old="40000000";

}elseif ($currank == "Supreme Racer"){
    $max = '80000000';
    $old = "60000000";

}elseif ($currank == "Blacklisted Racer"){
    $max = '100000000';
    $old="80000000";

}elseif ($currank == "Divine Racer"){
    $max = '130000000';
    $old="100000000";

}elseif ($currank == "Notorious Racer"){
    $max = '160000000';
    $old="130000000";

    }elseif ($currank == "Outlaw Racer"){
    $max = '180000000';
    $old="160000000";

}elseif ($currank == "Most Notorious Racer"){
    $max = '200000000';
    $old="180000000";

}elseif ($currank == "Extreme Racer"){
    $max = '250000000';
    $old="200000000";

}elseif ($currank == "Top Class Racer"){
    $max = '300000000';
    $old="250000000";

}elseif ($currank == "Legendary Racer"){
    $max = '3000000000';
    $old="300000000";

}



    $percent = round((($rankp-$old)/($max-$old))*100)

?>

<td align='right'>Rank:&nbsp;</td><td><?php   

if ($fetch->rank == "New Generation"){ 
    echo "New Generation (1)";

}elseif ($fetch->rank == "Boy/Girl Racer"){ 
    echo "Boy/Girl Racer (2)";

}elseif ($fetch->rank == "Speeder"){ 
    echo "Speeder (3)";

}elseif ($fetch->rank == "Skilled Racer"){ 
    echo "Skilled Racer (4)";

    }elseif ($fetch->rank == "Street Racer"){ 
    echo "Street Racer (5)";

    }elseif ($fetch->rank == "Respected Racer"){ 
    echo "Respected Racer (6)";        

    }elseif ($fetch->rank == "Amateur Racer"){ 
    echo "Amateur Racer (7)";




}elseif ($fetch->rank == "Pro Racer"){ 
    echo "Pro Racer (8)";


}elseif ($fetch->rank == "Wanted Racer"){ 
    echo "Wanted Racer (9)";

}elseif ($fetch->rank == "Most Wanted Racer"){ 
    echo "Most Wanted Racer (10)";

}elseif ($fetch->rank == "Supreme Racer"){ 
    echo "Supreme Racer (11)";

}elseif ($fetch->rank == "Blacklisted Racer"){ 
    echo "Blacklisted Racer (12)";

}elseif ($fetch->rank == "Divine Racer"){ 
    echo "Divine Racer (13)";

}elseif ($fetch->rank == "Notorious Racer"){ 
    echo "Notorious Racer (14)";

}elseif ($fetch->rank == "Outlaw Racer"){ 
    echo "Outlaw Racer (15)";

}elseif ($fetch->rank == "Most Notorious Racer"){ 
    echo "Most Notorious Racer (16)";

}elseif ($fetch->rank == "Extreme Racer"){ 
    echo "Extreme Racer (17)";

}elseif ($fetch->rank == "Top Class Racer"){
    echo "Top Class Racer (18)";

}elseif ($fetch->rank == "Legendary Racer"){ 
    echo "Legendary Racer (19)";}




?></td>

0 个答案:

没有答案