gddh
continuous-integration/drone/push Build is passing Details

ServeurDeTest
nathan boileau 2 years ago
parent 6dd711bf26
commit 9995efb9aa

@ -5,7 +5,7 @@ Autoload::charger();
$db = new Connection(); $db = new Connection();
//Insert a new user in the database //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=$db->prepare("INSERT INTO Utilisateur VALUES (:email, :password, :pseudo, :admin)");
$stm->bindValue(':email', "e",SQLITE3_TEXT); $stm->bindValue(':email', "e",SQLITE3_TEXT);
$stm->bindValue(':password', "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->bindValue(':admin', 0, SQLITE3_INTEGER);
$stm->execute(); $stm->execute();
//Select all users in the database
$res = $db->query('SELECT * FROM Utilisateur'); $res = $db->query('SELECT * FROM Utilisateur');
while ($row = $res->fetchArray(SQLITE3_ASSOC)) { // Select all the users in the database
echo $row['email'] . "\n"; while ($row = $res->fetchArray()) {
echo $row['email'] . " " . $row['password'] . " " . $row['pseudo'] . " " . $row['admin'] . " ";
} }

Loading…
Cancel
Save