i hope you dng good,i m working in school project that manage all influence inside it,i got a problem as the image descrip it duplicate each row my purpose is to show just one 'MATIERE' with all 'NOTE_DEVOIR'(devoir in the table),but i got each matiere duplicate as much of 'devoir' we have in this one.
NOTE:a teacher add 'NOTE_DEVOIR' with their 'MODULE_DEVOIR' ,it mean the 'MODULE' are duplicate each time with 'NOTE_DEVOIR' in database
I NEED TO HIDE NOT TO DELETE
PHP :
echo"<br><button class='btn btn-info cursor' name='butAf'>Afficher</button>";
if(isset($_POST['butAf']))
{
/*ID_CLASS and ID_ANNEE just to filter the class and the year of study*/
$query5 = "select * from devoir inner join prof_an_cls on prof_an_cls.ID_PROF_AN_CLS = devoir.ID_PROF_AN_CLS where CIN_ELEVE = '$cinE' and ID_ANNEE=$ID_ANNEE and ID_CLASS = $ID_CLASS";
$result5 = mysqli_query($con,$query5);
if(mysqli_num_rows($result5)>0)
{
echo"<table class='table table-bordered table-striped table-hover table-info'><tr>
<th>MATIERE</th>
<th>devoir1</th>
<th>devoir2</th>
<th>devoir3</th>
<th>devoir4</th>
<th>devoir5</th>
</tr>
";
while($rows = mysqli_fetch_assoc($result5))
{/*i guess this loop its the reason of duplicating */
$moduleD = $rows['MODULE_DEVOIR'];
$queryDEV = "select * from devoir inner join eleve on devoir.CIN_ELEVE = eleve.CIN_ELEVE where eleve.CIN_ELEVE = '$cinE' and MODULE_DEVOIR = '$moduleD' order by MODULE_DEVOIR";
$resultDEV = mysqli_query($con,$queryDEV);
echo"<tr><td>$moduleD</td>";
while($rows = mysqli_fetch_assoc($resultDEV))/*loop2*/
{
$noteDEV = $rows['NOTE_DEVOIR'];
echo"<td>$noteDEV</td>";
}
echo"</tr>";
}
echo"</table>";
}
}