From 739a0926204d0409032a71788e810796088405c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20BOUHOURS?= Date: Mon, 9 Jan 2023 20:28:27 +0100 Subject: [PATCH] =?UTF-8?q?Mise=20=C3=A0=20jour=20de=20'api-rest/index.php?= =?UTF-8?q?'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- api-rest/index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/api-rest/index.php b/api-rest/index.php index c3b8722..2df4aa3 100644 --- a/api-rest/index.php +++ b/api-rest/index.php @@ -20,7 +20,7 @@ // ------ //$ini_array= parse_ini_file("config.ini"); - $dsn = "mysql:host=db".";port=3036;dbname=". getenv("MYSQL_DATABASE"); + $dsn = "mysql:host=".getenv("DB_SERVER").";port=3036;dbname=". getenv("MYSQL_DATABASE"); $username = "root"; $password = getenv("MYSQL_ROOT_PASSWORD"); @@ -32,6 +32,7 @@ } catch (PDOException $e) { echo "ERROR connection"; echo $e->getMessage(); + echo $dsn; header("HTTP/1.0 ".$e->getMessage()); http_response_code(600); // Quel code pour les erreurs PDO? }