Refactor
This commit is contained in:
parent
6c33bd7322
commit
c493de8f21
1 changed files with 9 additions and 3 deletions
|
@ -12,17 +12,23 @@ namespace wishthis;
|
|||
|
||||
class Database
|
||||
{
|
||||
public \PDO $pdo;
|
||||
|
||||
/**
|
||||
* Private
|
||||
*/
|
||||
private int $lastInsertId;
|
||||
|
||||
/**
|
||||
* Public
|
||||
*/
|
||||
public \PDO $pdo;
|
||||
|
||||
public function __construct(
|
||||
public string $host,
|
||||
public string $database,
|
||||
public string $user,
|
||||
public string $password,
|
||||
) {
|
||||
$dsn = 'mysql:host=' . $this->host . ';dbname=' . $this->database . ';port=3306;charset=utf8';
|
||||
$dsn = 'mysql:host=' . $this->host . ';dbname=' . $this->database . ';port=3306;charset=utf8';
|
||||
$options = array();
|
||||
|
||||
$this->pdo = new \PDO($dsn, $this->user, $this->password, $options);
|
||||
|
|
Loading…
Reference in a new issue