Commit
This commit is contained in:
parent
972574d293
commit
836c5dc183
@ -21,16 +21,10 @@ class Database
|
|||||||
|
|
||||||
private function connectWithMySQL(array $args): object
|
private function connectWithMySQL(array $args): object
|
||||||
{
|
{
|
||||||
$host = $args['host'];
|
$dsn = "mysql:host={$args['host']};dbname={$args['database']};charset={$args['charset']}";
|
||||||
$database = $args['database'];
|
|
||||||
$charset = $args['charset'];
|
|
||||||
$user = $args['user'];
|
|
||||||
$password = $args['password'];
|
|
||||||
|
|
||||||
$dsn = "mysql:host=$host;dbname=$database;charset=$charset";
|
|
||||||
$options = [
|
$options = [
|
||||||
PDO::ATTR_PERSISTENT => true,
|
PDO::ATTR_PERSISTENT => true,
|
||||||
];
|
];
|
||||||
return new PDO($dsn, $user, $password, $options);
|
return new PDO($dsn, $args['user'], $args['password'], $options);
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue
Block a user