Affichage dans un tableau
Bonjour,
J'ai un soucis d'affichage de valeur dans un tableau. Je fais une requête MySQL que j'affiche ensuite dans un tableau sur une page. Mon problème est qu'il me manque toujours une ligne..
Lorsque j’exécute la requête dans mysql workbench c'est OK mais pas dans ma page HTML...:(
Ci-joint mon code:
Ma requête SQL:
Code:
1 2 3 4 5
|
$query2 = "SELECT * FROM scrap WHERE DATEPROCESSNEW BETWEEN '".$DateEndFull."' AND '".$DateStartFull."' Order By DATEPROCESSNEW DESC";
mysqli_query($db, $query2) or die('Error querying database.');
$result2 = mysqli_query($db, $query2);
$row2 = mysqli_fetch_array($result2); |
La partie HTML/PHP pour affichage:
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
|
<table class="data-table">
<caption class="title"><?php echo $row[0]." rebut"; ?><?php if ($row[0]>1){echo "s sur la période du ".$DateEndFull." au ".$DateStartFull; } ?></caption><BR />
<thead>
<tr>
<th>Ligne</th>
<th>Station</th>
<th>Date du process</th>
<th>Référence</th>
<th>ID</th>
<th>Analyse</th>
<th>Code NCC</th>
</tr>
</thead>
<tbody>
<?php
while ($row2 = mysqli_fetch_array($result2)) {
echo '<tr>
<td>'.$row2['LIGNE'].'</td>
<td>'.$row2['STATION'].'</td>
<td>'.$row2['DATEPROCESSNEW'].'</td>
<td>'.$row2['REFERENCE'].'</td>
<td>'.$row2['IDENTETE'].'</td>
<td>'.$row2['ANALYSE'].'</td>
<td>'.$row2['ANALYSECODE'].'</td>
</tr>';
}?>
</tbody>
</table> |
Si quelqu'un a une idée, je suis preneur...
Merci par avance pour votre aide.