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 39 40 41 42 43
| <!--*************************COMPLETION DU TABLEAU*************************-->
<?php
$db=mysql_connect("localhost","root","") OR DIE("Connexion impossible au serveur"); //Connexion à la base de données
mysql_select_db("base_absence",$db) OR DIE("Connexion impossible à la base de données"); //Sélection de la base de données
error_reporting(E_ALL);
function tabhtml()
{
$donnee = "t_abs";
$req = "select * from $tab";
$result = Mysql_query($req);
?>
<table>
<?php
while ($donnee=mysql_fetch_array($result))
{
//Récupération des données
$Nom=$donnee['Nom'];
$Jour=$donnee['Jour'];
$Mois=$donnee['Mois'];
$NbJour=$donnee['NbJour'];
$Cause=$donnee['Cause'];
?>
<tr>
<td> <? echo '$Nom'; ?> </td> <!-- Affichage dans le champ -->
<td> <? echo '$Jour'; ?> </td>
<td> <? echo '$Mois'; ?> </td>
<td> <? echo '$NbJour'; ?> </td>
<td> <? echo '$Cause'; ?> </td>
</tr>
<?php }}
tabhtml();
mysql_close(); ?>
</table>
</body>
</html> |
Partager