5499ba92e1cc09cdd90eea58e6d1ca8772fb891d
[Project_webapp.git] / home.php
1 <?php
2 function home()
3 {
4 global $configs;
5
6 $connection = new CustomDB($configs['host'], $configs['username'], $configs['password'], $configs['database']);
7 $requete = "SELECT NumCl, NomCl, CodePosteCl, VilleCl FROM CLIENTS";
8 $result = $connection->query($requete);
9 echo "<table border=1>\n";
10 echo "<tr><td>Code_CL</td><td>Nom</td><td>Rue</td><td>Ville</td></tr>\n";
11 while ($ligne = $result->fetch_row()) {
12 $code = htmlentities($ligne[0]);
13 $nom = htmlentities($ligne[1]);
14 $rue = htmlentities($ligne[2]);
15 $ville = htmlentities($ligne[3]);
16 echo "<tr><td>$code</td><td>$nom</td><td>$rue</td><td>$ville</td></tr>\n";
17 }
18 echo "</table>\n";
19 $result->close();
20 $connection->close();
21 }
22
23 home();
24
25 ?>