
Let the image above explain it briefly.
What I want to do (but obviously can't) is to display the corresponding score of each teams (CAS, CEIT, CASNR, CSE) in the sports displayed in the first column.
This is what I have so far..
<table class="table table-bordered">
        <thead>
        <tr>
          <th>Games</th>
          <th class="danger">CAS</th>
          <th class="warning">CEIT</th>
          <th class="success">CASNR</th>
          <th class="info">CSE</th>
        </tr>
        </thead>
        <tbody>
        <?php
        include('connection.php');
              $sportid = '';
              $query=mysql_query("SELECT * FROM sports ORDER BY sportname")or die(mysql_error());
              while($row=mysql_fetch_array($query))     {
                      $sportid = $row['sportid'];
            ?>
        <tr>
        <td><input type="hidden" id="sportid[]" name="sportid[]" value="<?php echo $row['sportid']; ?>"><?php echo $row['sportname']; ?> </td>
        <td>0</td>
        <td>0</td>
        <td>0</td>
        <td>0</td>      
        <?php  } ?>
        </tr>
        <tr>
          <td class="success">Total Points</td>
          <td class="info">0</td>
          <td class="info">0</td>
          <td class="info">0</td>
          <td class="info">0</td>
        </tr>
      </tbody>
</table>
P.S. If there's no data available from table score for that team in a specific sport, it still should display zero.
 
     
     
     
    