How do I introduce 3 players from a team?

0

I want to present 3 players who are from the same team, but for this I want the team name to appear only once.

$query = "SELECT distinct nometeam from jogador";

$dados = mysqli_query($conn, $query) or die(mysql_error());

$linha = mysqli_fetch_assoc($dados);

$total = mysqli_num_rows($dados);
?>

<center>

<table class = "tabela" style="width:100%" border="0" bgcolor="white" style="text-align:center;">  

    <tr> 
        <td allign = 'left'><b> Nome da Equipa </b></td>

        <td allign = 'center'><b> Nome do Jogador </b></td>

        <td allign = 'center' colspan = '3'><b> Pontuação do Jogador </b></td>

    </tr>

     <?php
     if($total){ do {

        $query1 = "SELECT * from 'jogador', 'pontos' WHERE 'nometeam' = '".$linha['nometeam']."'" ;

        $dados1 = mysqli_query($conn, $query1);

        $linha1 = mysqli_fetch_array($dados1);      
    ?>

    <tr>        
        <td><?php echo $linha['nometeam'] ?></td>

        <td><?php echo $linha1['nome'] ?><td>

        <td><?php echo $linha1['pontos'] ?></td>
    </tr>

    <?php
         }while($linha = mysqli_fetch_assoc($dados));}
    ?>  


</table>

</center>

</body>

</html>
    
asked by anonymous 24.05.2018 / 12:53

0 answers