title: student result with their position in class
body: <p>I need help on this script, I printed out the student result and try to get their position in class.</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;table border="0" cellspacing="1" cellpadding="0"&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;p align="center"&gt;&lt;strong&gt;Student     Name&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
  &lt;td&gt;&lt;p align="center"&gt;&lt;strong&gt;Computer&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
  &lt;td&gt;&lt;p align="center"&gt;&lt;strong&gt;Position&lt;/strong&gt;&lt;/p&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;p&gt;Agbo Cynthia &lt;/p&gt;&lt;/td&gt;
  &lt;td&gt;&lt;p&gt;21.0&lt;/p&gt;&lt;/td&gt;
  &lt;td&gt;&lt;p&gt; &lt;/p&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;p&gt;Nwoye Ugochukwu &lt;/p&gt;&lt;/td&gt;
  &lt;td&gt;&lt;p&gt;76.0&lt;/p&gt;&lt;/td&gt;
  &lt;td&gt;&lt;p&gt;&lt;/p&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;p&gt;Ogburie Kosisochukwu &lt;/p&gt;&lt;/td&gt;
  &lt;td&gt;&lt;p&gt;28.0&lt;/p&gt;&lt;/td&gt;
  &lt;td&gt;&lt;p&gt; &lt;/p&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td&gt;&lt;p&gt;Okechukwu Onyeka &lt;/p&gt;&lt;/td&gt;
  &lt;td&gt;&lt;p&gt;38.0&lt;/p&gt;&lt;/td&gt;
  &lt;td&gt;&lt;p&gt; &lt;/p&gt;&lt;/td&gt;
  &lt;/tr&gt;
  &lt;/table&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Having try scripts to determine the student position base on their score that have in db, I could not eventually get the right script. 
  I make use of this scripts bellow, but it repeating scores value.</p>
  
  <p>$row['comp'] is the scores from each student from db</p>
  
  <pre><code>&lt;?php
  $grades = array(''.$row['comp'].'');
  $occurrences = array_count_values($grades);
  $grades = array_unique($grades);
  foreach($grades as $grade) 
     {
  echo str_repeat($grade .' - '.($i+1).'&lt;br&gt;',$occurrences[$grade]);
  $i += $occurrences[$grade];
     }
  ?&gt;
  </code></pre>
  
  <p>What I want is a script that will give the student in the class their position according to the computer score in db</p>