Example #1
0
 function __construct()
 {
     try {
         self::$DBH = new PDO("mysql:host={$this->host};dbname={$this->dbname}", $this->user, $this->pass);
     } catch (PDOException $e) {
         die('Подключение не удалось: ' . $e->getMessage());
     }
 }
Example #2
0
 function __construct()
 {
     try {
         self::$DBH = new PDO("mysql:host={$this->host};dbname={$this->dbname}", $this->user, $this->pass);
         self::$DBH->exec("set names utf8");
     } catch (PDOException $e) {
         die('Ошибка: ' . $e->getMessage());
     }
 }