Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class MySQL{
- private $hote;
- private $port;
- private $dbName;
- private $user;
- private $password;
- private $connect;
- public function __construc($hote, $port, $dbName, $user, $password) {
- $this->hote = $hote;
- $this->port = $port;
- $this->dbName = $dbName;
- $this->user = $user;
- $this->password = $password;
- }
- public function DBConnect() {
- try
- {
- $this->connect = new PDO('mysql:host='.$this->hote.';dbname='.$this->dbName, $this->user, $this->password);
- }
- catch(Exception $e)
- {
- echo 'Erreur : '.$e->getMessage().'<br />';
- echo 'N° : '.$e->getCode();
- }
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement