Ejemplo n.º 1
0
 public function __construct()
 {
     try {
         //self::$connectlink = new PDO("sqlsrv:Server=MUNISH-HP\SQLEXPRESS;Database=ezae", 'sa', 'password');
         self::$connectlink = new PDO("mysql:dbname=" . $this->database . ";host=" . $this->hostname, $this->username, $this->password);
     } catch (PDOException $e) {
         die("Database Connection Failed: " . $e->getMessage());
     }
 }
Ejemplo n.º 2
0
 public function __construct()
 {
     try {
         //$con1 = new PDO("mysql:dbname=envirotechlive;host=localhost" ,"root","rootadmin");
         self::$connectlink = new PDO("mysql:dbname=" . $this->database . ";host=" . $this->hostname, $this->username, $this->password);
     } catch (PDOException $e) {
         die("Database Connection Failed: " . $e->getMessage());
     }
 }