Advertisement
Guest User

Untitled

a guest
May 16th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 0.55 KB | None | 0 0
  1.         private $database;
  2.     // currently only one application user/password.
  3.     private $dbuser = 'application';
  4.         private $dbpass = '***********';
  5.  
  6. public function
  7. __construct($dbname,$dbhost='nexus.umn.edu',$dbuser='application')
  8. {
  9.  
  10.         $this->dbhost=$dbhost;
  11.         $this->dbname=$dbname;
  12.    
  13.     try {
  14.         $this->connection = new PDO('mysql:host='.$this->dbhost.';dbname='.$this->dbname, $this->dbuser, $this->dbpass);
  15.         $this->database = new Database($this->connection);
  16.     }
  17.     catch (PDOException $e) {
  18.         $this->fail();
  19.     }
  20.     return $this;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement