%PDF- %PDF-
Direktori : /proc/thread-self/root/proc/self/root/home/medipszd/www/includes/ |
Current File : //proc/thread-self/root/proc/self/root/home/medipszd/www/includes/conn.php |
<?php Class Database{ private $server = "mysql:host=localhost;dbname=medipszd_ecomm"; private $username = "medipszd_med"; private $password = "MOKhlesur@#$1981"; private $options = array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,); protected $conn; public function open(){ try{ $this->conn = new PDO($this->server, $this->username, $this->password, $this->options); return $this->conn; } catch (PDOException $e){ echo "There is some problem in connection: " . $e->getMessage(); } } public function close(){ $this->conn = null; } } $pdo = new Database(); ?>