NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming
Reload this Page Creating ranks with 2 ranks...?

Programming PHP, Perl, Ruby on Rails, AJAX, HTML, XHTML, CSS, JavaScript, MySQL and any other coding topics.

Advanced Search
5 members in live chat ~  


Closed Thread
 
LinkBack Thread Tools
Old 08-24-2004, 01:52 AM THREAD STARTER               #1 (permalink)
New Member
Join Date: Jul 2004
Location: Miami, Florda
Posts: 23
WorldHatred is an unknown quantity at this point
 



Creating ranks with 2 ranks...?


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.
__________________
Wanna buy a game source code? Just PM me.
Dopewars Clone - 3 copies left
Kings of Chaos V2 Clone - 4 copies left and Rise of Chaos - 1 copy left
Pimpgame V6 Clone - 3 copies left (based on pimpwar)
WorldHatred is offline  
Old 08-24-2004, 02:23 AM   #2 (permalink)
RJ
NamePros Admin


 
RJ's Avatar
Join Date: Feb 2003
Posts: 12,919
RJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatnessRJ Has achieved greatness
 



Find Marrow Donors! Cystic Fibrosis Parkinson's Disease
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) ?
__________________
Reach me at rj at namepros dot com
RJ is offline  
Old 08-25-2004, 08:32 PM THREAD STARTER               #3 (permalink)
New Member
Join Date: Jul 2004
Location: Miami, Florda
Posts: 23
WorldHatred is an unknown quantity at this point
 



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];");
      }
__________________
Wanna buy a game source code? Just PM me.
Dopewars Clone - 3 copies left
Kings of Chaos V2 Clone - 4 copies left and Rise of Chaos - 1 copy left
Pimpgame V6 Clone - 3 copies left (based on pimpwar)
WorldHatred is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


 
All times are GMT -7. The time now is 02:26 PM.

Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger