Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Conexion
- {
- public $dbh;
- private $host = 'localhost';
- private $db = 'saeta-alcaldia';
- private $username = 'postgres';
- private $password = 'postgres';
- public function __construct()
- {
- $dsn = "pgsql:host=".$this->host.";port=5432;dbname=".$this->db.";user=".$this->username.";password=".$this->password;
- try {
- $this->dbh = new PDO($dsn);
- } catch (PDOException $e) {
- print "Error!: " . $e->getMessage();
- die();
- }
- }
- }
- ?>
Add Comment
Please, Sign In to add comment