title: How to show all fields while SUM them and show?
body: <p>I have a problem with showing all names that are grouped by, for example:</p>
  
  <p>This is my table:</p>
  
  <pre><code>IMEPRIIMEK  REZULTAT  EKIPA
  ------------------------------
  Ela         256       e13e01
  Joe         218       e13e01
  Tim         198       e13e01
  Dan         265       e13e02
  Jim         256       e13e02
  Kim         215       e13e02
  </code></pre>
  
  <p>With my code that I have made it I get this result:</p>
  
  <pre><code>#  EKIPA  TOTAL  IMEPRIIMEK
  -------------------------------
                   Dan
  1  e13e02  736   Jim
                   Kim
  ------------------------
                   Ela
  2  e13e01  672   Joe 
                   Tim
  </code></pre>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;?php
  
  $con = mysql_connect("localhost","root","");
  if (!$con)
    {
    die('Could not connect: ' . mysql_error());
    }
  
  mysql_select_db("paradox", $con);
  
  $result2 = mysql_query("SELECT NazivEkipe, ImePriimek, Rezultat,
                          SUM(Rezultat) AS 'total'
                          FROM tekmovanje
                          WHERE NazivEkipe='e13e01' OR NazivEkipe='e13e02' OR NazivEkipe='e13e03' OR NazivEkipe='e13e04' OR NazivEkipe='e13e05'
                          GROUP BY NazivEkipe
                          ORDER BY total DESC") or die(mysql_error());
  $rank = 0;
  while($row = mysql_fetch_array ($result2))
  {
  $rank++; 
  ?&gt;
  
  &lt;tr align="center" valign="middle"&gt;
       &lt;td rowspan="3" align="center" valign="middle"&gt;&lt;?php echo $rank; ?&gt;&lt;/td&gt;
  
       &lt;td rowspan="3" align="center" valign="middle" style="font-weight: bold; color: #008AFF;"&gt;&lt;?php echo $row['total']; ?&gt;&lt;/td&gt;
  
       &lt;td rowspan="3" align="center" valign="middle"&gt;&lt;?php echo $row['NazivEkipe']; ?&gt;&lt;/td&gt;
  &lt;tr align="center" valign="middle"&gt;
    &lt;td align="center" valign="middle" &gt;&lt;?php echo $row['ImePriimek']; ?&gt;&lt;/td&gt;
  &lt;/tr&gt;
  
  &lt;?php
  }
  ?&gt;
  
  &lt;/table&gt;
  </code></pre>
  
  <p>Help me, thank you for your answers.</p>
  
  <p>PS: This is for personal usage and it <strong>will not go online</strong>, so I don't care about SQL injection or doing this with PDO MySQLi</p>