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 44 45 46 47 48 49 50 51 52 53
| <html>
<head>
<title>Afficher la liste des employés</title>
</head>
<body>
<h1 class="Style2">Afficher la liste des employés</h1>
<p> </p>
<p> </p>
<?php
require 'params.php';
mysql_connect($host,$user,$password) or die('Erreur le connexion au SGBD.');
mysql_select_db($base) or die('La base de données n\'existe pas');
if(isset($_GET['l']))
$l=$_GET['l'];
else $l=1;
if($l==1)
$query='SELECT * FROM toto';
$r=mysql_query($query);
mysql_close();
echo' <table width="513" border="1">';
echo'<tr>';
echo'<th width="106" scope="col">NOM</th>' ;
echo'<th width="121" scope="col">PRENOM</th>';
echo'<th width="117" scope="col">SALAIRE</th>';
echo'<th width="141" scope="col">VILLE</th> ' ;
echo'</tr>';
echo'<tr>';
echo'<th scope="row"> </th>';
echo'<td> </td>' ;
echo'<td> </td>';
echo'<td> </td>';
echo'</tr>';
echo'</table>';
while($a=mysql_fetch_object($r))
{
$nom=$a->NOM;
$prenom=$a->PRENOM;
$salaire=$a->SALAIRE;
$ville=$a->ville;
//$ville=$a->VILLE;
echo"<tr><td>$nom</td><td>$prenom</td><td>$salaire</td><td>$ville</td></tr>";
}
echo '</table>';
?>
<br/>
</body>
</html> |
Partager