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