Caché les mdp. Les données récupérées sont mainenant jolies.

This commit is contained in:
2021-10-11 23:49:41 +02:00
parent 4af54d3715
commit bc6195600d
3 changed files with 45 additions and 11 deletions
+7 -2
View File
@@ -1,8 +1,13 @@
<?php
// Connection à la BDD:
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
include 'bddpass.php';
try {
$conn = new PDO("mysql:host=localhost;dbname=savrillo", savrillo, "BHTvo0JfS");
$conn = new PDO("mysql:host=localhost;dbname=savrillo", "savrillo", $bddpass, array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
// set the PDO error mode to exception
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch(PDOException $e) {
@@ -30,7 +35,7 @@ if($_GET["salle"] != NULL) {
$resP = $stmt->fetchAll();
for($i=0;$i<count($resP);$i++)
$locataires[$i] = $resP[$i]['nom'];
$locataires[$i] = $resP[$i]['personne'];
$stmt = $conn->prepare("SELECT id, nom, description FROM salles WHERE id=?");