The result of this query I want to convert to a table, since the query is a value of the same field called name
SELECT
id_departamento, departamento.nombre FROM 'departamento'
WHERE
departamento.id_raiz= '1'
Throw each of the team names out there
id_Departamento Nombre
4 Domper/Desestibador
5 Primera banda
6 Primer mesa de seleccion
7 Descarte de primer mesa
Etc .. are 42 names in total That information I want to show in a table
and I have this code
<?php
include("dbconnect.php");
$sql = $conn->prepare("SELECT id_departamento,
departamento.nombre FROM 'departamento' WHERE
departamento.id_raiz= '1' ");
$sql->execute();
if ($sql->rowCount () > 0){
echo "<table border = '1'> \n";
while($rows=$sql->fetch(PDO::FETCH_ASSOC)){
for ($i=0; $i < 6 ; $i++) {
echo "<tr>";
for ($j=0; $j < 7 ; $j++) {
echo "<td>".$rows['nombre']."</td>";
}
echo "</tr>";
}
}
echo "</table>";
}
?>
I would like to know how I do it so that I do not repeat each row, but send me a box with all the information as it is but that is not repeated