From 9995efb9aa18803212838748d2500b5bb08dac98 Mon Sep 17 00:00:00 2001 From: nathan boileau Date: Fri, 25 Nov 2022 19:10:20 +0100 Subject: [PATCH] gddh --- WEB/index.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/WEB/index.php b/WEB/index.php index dc8dd0e8..2eb12245 100644 --- a/WEB/index.php +++ b/WEB/index.php @@ -5,7 +5,7 @@ Autoload::charger(); $db = new Connection(); //Insert a new user in the database -$db->exec('INSERT INTO Utilisateur VALUES ("e","e","e", false)'); +// $db->exec('INSERT INTO Utilisateur VALUES ("e","e","e", false)'); $stm=$db->prepare("INSERT INTO Utilisateur VALUES (:email, :password, :pseudo, :admin)"); $stm->bindValue(':email', "e",SQLITE3_TEXT); $stm->bindValue(':password', "e" ,SQLITE3_TEXT); @@ -13,10 +13,10 @@ $stm->bindValue(':pseudo', "e", SQLITE3_TEXT); $stm->bindValue(':admin', 0, SQLITE3_INTEGER); $stm->execute(); -//Select all users in the database $res = $db->query('SELECT * FROM Utilisateur'); -while ($row = $res->fetchArray(SQLITE3_ASSOC)) { - echo $row['email'] . "\n"; +// Select all the users in the database +while ($row = $res->fetchArray()) { + echo $row['email'] . " " . $row['password'] . " " . $row['pseudo'] . " " . $row['admin'] . " "; }