title: Stuck with skill based ranking system
body: <p>I am working on a new tournament script for my startup. I know my way around basic-intermediate php. I have been working on a skilled based system for the site, it involves using xp or Experience points that each member receives for winning a match in a tournament. The issue i am currently attempting to overcome is as follows</p>
  
  <p>I would like to give out specific rankings to only a select few users on the site. </p>
  
  <p>Example</p>
  
  <pre><code>Platinum - top 3% of users with highest xp
  Gold - top 5% of users with highest xp - after the first 3% 
  Bronze - rest of the users on site with xp
  Unranked - users with 0 xp
  </code></pre>
  
  <p>That is a basic breakdown. All i really need to do is create a classification system for this, on the user end all that is going to be visible with this is a large icon displaying the rank and their place example, 1st on the site, etc.</p>
  
  <p>The issue i am having is correctly identifying or separating the top 3% from the rest of the users, then the top 5%, etc. It is easy to give rankings out all i did was order the users by xp descending using a cron job at midnight and i would have that write the rank in a database column associated with user id. This way when a user is visiting the page all that needs to be loaded to view the page is the db column instead of sifting through all of the members on page load. Is there a better way to set this up that will not impact page load times and allow me to display stats in real time? </p>
  
  <p>I am still learning so i am not asking to be handed the direct answer, i would appreciate any and all help as it would allow me to figure out the correct way to set this up and i can learn from it. All ranking systems that i have found on here as well as google only have to do with 1-5 stars or likes and dislikes. Thank you in advance. ( I included the pdo tag because i am using pdo )</p>
  
  <p><strong>Ok thank you for the help. This is where i am at so far.</strong> </p>
  
  <pre><code>$u_count=d_c("select * from users where xp &gt; 0");
  
  $p = $u_count * .03;
  
  $plat_update=d_u("update user where rank Between 1/$p set badge='platinum'");
  
  $g = $u_count - $p;
  
  $gold = $g * .05;
  
  $g_start = $p + 1;
  
  $gold_update=d_u("update user where rank Between $g_start/$gold set badge='gold'");
  </code></pre>
  
  <p>Would this be correct? Is there a better way of doing things? ( I left out bronze and unranked my only issue was with platinum and gold ) </p>