Guest User

Untitled

a guest
Jan 16th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. <?php
  2. class Conexion
  3. {
  4.  
  5. public $dbh;
  6. private $host = 'localhost';
  7. private $db = 'saeta-alcaldia';
  8. private $username = 'postgres';
  9. private $password = 'postgres';
  10. public function __construct()
  11. {
  12. $dsn = "pgsql:host=".$this->host.";port=5432;dbname=".$this->db.";user=".$this->username.";password=".$this->password;
  13. try {
  14. $this->dbh = new PDO($dsn);
  15. } catch (PDOException $e) {
  16. print "Error!: " . $e->getMessage();
  17. die();
  18. }
  19. }
  20. }
  21. ?>
Add Comment
Please, Sign In to add comment