%PDF- %PDF-
Direktori : /home/medipszd/public_html/includes/ |
Current File : /home/medipszd/public_html/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(); ?>