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 30 31 32 33 34 35 36 37 38
| <?php
echo "<table border=\"1\" align = \"center\">
<tbody>
<tr>
<td><strong>Id</strong>/td>
<td><strong>Anglais</strong></td>
<td><strong>Français</strong></td>
</tr>";
$reponse = $bdd->query("SELECT id , Anglais, Francais FROM `vocabulaire_anglais` WHERE `date` = '$date'");
$count = $reponse->rowCount();
while ($donnees = $reponse->fetch())
{
$id = $donnees['id'];
$anglais = $donnees['Anglais'];
$francais = $donnees['Francais'];
if ( $count > "0" )
{
echo "il y a $count résultat-s";
echo "<tr>
<td>$id</td>
<td>$anglais</td>
<td>$francais</td>
</tr>";
}
else
{
echo "il y a $count résultat";
echo "<tr><td colspan=\"3\" align=\"center\">Pas de réponse</td></tr>";
}
}
$reponse->closeCursor();
echo "
</tbody>
</table>";
?> |