NameSilo

Creating ranks with 2 ranks...?

SpaceshipSpaceship
Watch

WorldHatred

Established Member
Impact
0
Never really done this before, but i got as far as usort, and then kinda just lost it.

What im trying to do, is upgrade users ranks by 2 numbers.
user 1 - 1:2
user 2 - 3:3
user 3 - 2:1

User 1 would be ranked 1st
User 2 would be ranked 3rd
User 3 would be ranked 1st, but would show 2nd by default cause user 1 comes before user 3.

Anyway, so i have a table called "users", with the 3 fields "rank, attackrank, defencerank"
I want to upgrade their ranks by attackrank and defencerank.

Not sure if im making sense.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable Domains โ€” AI StorefrontUnstoppable Domains โ€” AI Storefront
Let me see if I understand it right. You have two independent rankings already. You want to then average the two ranking systems into one "master rank" ?

If the two original rankings are considered equally, couldn't you just add the two rankings together and then assign the new rank based on this combined score (1st - lowest combined total) ?
 
0
•••
Yea, thats exactly what i did.

Code:
$get = mysql_query("SELECT id,name,((damrank + defrank) / 2) AS avgrank FROM $tab[player] ORDER BY avgrank ASC;");
$rank = 0;
while ($user = mysql_fetch_array($get))
      {
	   $rank++;
	   mysql_query("UPDATE $tab[player] SET rank='$rank' WHERE id=$user[id];");
      }
 
0
•••
Spaceship
Domain Recover
CatchDoms
NameMaxi - Your Domain Has Buyers
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back