<?php 

    class Connection {

        private $hostname = 'localhost';
        private $user = 'appmempr_webclient';
        private $password = 'webclient@9009';
        private $database = 'appmempr_mautic';
        private $options = array(
            PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'
        );

        public function getConnection() {

            //return new PDO("mysql:host={$this->hostname};dbname={$this->database}", $this->user, $this->password, $options);
            
            $dsn = "mysql:host=".$this->hostname.";dbname=".$this->database.";charset=utf8mb4";
            $pdo = new PDO($dsn, $this->user, $this->password);
            $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);

            return $pdo;
            
        }

    }