Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class connection {
- private $database;
- private $host;
- private $port;
- private $user;
- private $pass;
- public $db;
- public function __construct(){
- $this->user='postgres';
- $this->pass='secret';
- $this->host='localhost';
- $this->database='form';
- $this->port=5432;
- $this->db=new PDO("pgsql:host=".$this->host.
- ";port=".$this->port.
- ";dbname=".$this->database
- ,"'".$this->user."'"
- ,"'".$this->pass."'");
- $this->db->exec("SET CHARACTER SET utf8");
- return $this->db;
- }
- public function __clone(){
- trigger_error('The clone is not allowed', E_USER_ERROR);
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement