From 76528e8c8813d0b61c07985eab5dcdb1bd00b14b Mon Sep 17 00:00:00 2001 From: nathan boileau Date: Fri, 25 Nov 2022 18:07:49 +0100 Subject: [PATCH] bd --- WEB/Config/Connection.php | 5 +++-- WEB/Controller/FrontController.php | 1 + WEB/Controller/UserController.php | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/WEB/Config/Connection.php b/WEB/Config/Connection.php index c77cc467..3de12928 100644 --- a/WEB/Config/Connection.php +++ b/WEB/Config/Connection.php @@ -2,8 +2,9 @@ class Connection extends PDO { private $stmt; - public function __construct(string $dsn, string $username, string $password) { - parent::__construct($dsn,$username,$password); + public function __construct(string $dsn) { + parent::__construct($dsn); + echo "connection"; $this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); } public function executeQuery(string $query, array $parameters = []) :bool { diff --git a/WEB/Controller/FrontController.php b/WEB/Controller/FrontController.php index 75da9c81..e7f34540 100644 --- a/WEB/Controller/FrontController.php +++ b/WEB/Controller/FrontController.php @@ -6,6 +6,7 @@ class FrontController session_start(); // $role=$_SESSION['role']; // $action=$_REQUEST['action']; + echo "front"; new UserController(); } } \ No newline at end of file diff --git a/WEB/Controller/UserController.php b/WEB/Controller/UserController.php index 7b0afdd9..764c14c8 100644 --- a/WEB/Controller/UserController.php +++ b/WEB/Controller/UserController.php @@ -6,10 +6,11 @@ class UserController function __construct() { global $dsn, $user, $password; - $this->con=new Connection($dsn, $user, $password);; + $this->con=new Connection($dsn);; try{ global $rep, $vues, $error; $action=$_REQUEST['action']; + echo "userController"; switch($action) { case NULL: require ($rep.$vues['main']);