From 2b55eb78946a73c23cc7a8cfe9f314f22a1ad9e4 Mon Sep 17 00:00:00 2001 From: Benjamin Kraft Date: Thu, 13 Jun 2024 01:43:32 +0200 Subject: [PATCH] added mysql database value to dotenv --- .env.example | 5 +++++ public/util/mysql_connect.php | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 .env.example diff --git a/.env.example b/.env.example new file mode 100644 index 0000000..ed5c22d --- /dev/null +++ b/.env.example @@ -0,0 +1,5 @@ +MYSQL_PORT= +MYSQL_USER= +MYSQL_PASSWORD= +MYSQL_DATABASE= +RIOT_API_KEY= \ No newline at end of file diff --git a/public/util/mysql_connect.php b/public/util/mysql_connect.php index d29b3a5..8e0fb33 100644 --- a/public/util/mysql_connect.php +++ b/public/util/mysql_connect.php @@ -8,7 +8,7 @@ class MySQLConnection { private string $host; private string $user; private string $pass; - private string $dbName = "uem"; + private string $dbName; private mysqli $mysqli; public function __construct() { @@ -16,6 +16,7 @@ class MySQLConnection { $this->port = intval($_ENV['MYSQL_PORT']); $this->user = $_ENV['MYSQL_USER']; $this->pass = $_ENV['MYSQL_PASSWORD']; + $this->dbName = $_ENV['MYSQL_DATABASE']; $this->createConn(); }