[add] Parametrizing
This commit is contained in:
parent
d2b9163537
commit
f16e9fe72c
@ -24,6 +24,7 @@ $container['mysql'] = function ($c) {
|
||||
|
||||
// The database parameters
|
||||
$host = $mysqlSettings['host'];
|
||||
$port = $mysqlSettings['port'];
|
||||
$database = $mysqlSettings['database'];
|
||||
$user = $mysqlSettings['user'];
|
||||
$password = $mysqlSettings['password'];
|
||||
@ -34,7 +35,7 @@ $container['mysql'] = function ($c) {
|
||||
$databaseConnectionErrorMessage = $mysqlSettings['databaseConnectionErrorMessage'];
|
||||
|
||||
// Initiate the connection
|
||||
$dsn = "mysql:host=$host;port=3307;dbname=$database;charset=$charset";
|
||||
$dsn = "mysql:host=$host;port=$port;dbname=$database;charset=$charset";
|
||||
try {
|
||||
$pdo = new PDO($dsn, $user, $password, $pdoConnectionOptions);
|
||||
} catch (Exception $e) {
|
||||
|
@ -27,6 +27,7 @@ return [
|
||||
// Datanase settings
|
||||
'mysql' => [
|
||||
'host' => 'mysql',
|
||||
'port' => '3307',
|
||||
'database' => 'payroll',
|
||||
'user' => 'root',
|
||||
'password' => '12345678',
|
||||
|
Loading…
Reference in New Issue
Block a user