| 1 | <?php |
| 2 | |
| 3 | function home() |
| 4 | { |
| 5 | global $connection; |
| 6 | |
| 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 | } |
| 21 | |
| 22 | home(); |
| 23 | |
| 24 | ?> |