Jump to content

help with ranking system, selecting a rank between 2 values


mattm1712

Recommended Posts

hi i have a table like this

 

 

rank        xp

1              0

2            50

3            100

4            200

 

say my username has 75xp how would a select which rank i am

 

not sure how i can do this? :S

 

cheers matt

switch(TRUE)
{
  case $xp == 0:
    $rank = 1;
    break;
  case $xp <= 50:
    $rank = 2;
    break;
  case $xp <= 100:
    $rank = 3;
    break;
  case $xp <= 200:
    $rank = 4;
    break;
}

 

$rank will hold your rank.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.