Tidy a bit the files structure.
[Project_webapp.git] / includes / home.php
diff --git a/includes/home.php b/includes/home.php
new file mode 100644 (file)
index 0000000..cc378a2
--- /dev/null
@@ -0,0 +1,24 @@
+<?php
+
+function home()
+{
+    global $connection;
+
+    $requete = "SELECT NumCl, NomCl, CodePosteCl, VilleCl FROM CLIENTS";
+    $result = $connection->query($requete);
+    echo "<table border=1>\n";
+    echo "<tr><td>Code_CL</td><td>Nom</td><td>Rue</td><td>Ville</td></tr>\n";
+    while ($ligne = $result->fetch_row()) {
+        $code = htmlentities($ligne[0]);
+        $nom = htmlentities($ligne[1]);
+        $rue = htmlentities($ligne[2]);
+        $ville = htmlentities($ligne[3]);
+        echo "<tr><td>$code</td><td>$nom</td><td>$rue</td><td>$ville</td></tr>\n";
+    }
+    echo "</table>\n";
+    $result->close();
+}
+
+home();
+
+?>