conn = null; try { $this->conn = new PDO("dblib:host=" . $this->host . ";dbname=" . $this->db_name.";charset=CP1251", $this->username, $this->password); } catch (PDOException $exception) { echo "Ошибка соединения с БД: " . $exception->getMessage(); } return $this->conn; } }