diff options
Diffstat (limited to 'public_html/class/mysql.php')
| -rw-r--r-- | public_html/class/mysql.php | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/public_html/class/mysql.php b/public_html/class/mysql.php new file mode 100644 index 0000000..b2d2983 --- /dev/null +++ b/public_html/class/mysql.php @@ -0,0 +1,28 @@ +<?php + +class database { + + public $db; + private $dbhost; + private $dbuser; + private $dbpassword; + private $dbname; + private $dbprefix; + + public function __construct($dbhost, $dbuser, $dbname, $dbpassword, $dbprefix){ + $this->dbhost=$dbhost; + $this->dbuser=$dbuser; + $this->dbname=$dbname; + $this->dbpassword=$dbpassword; + $this->dbprefix=$dbprefix; + } + + public function open(){ + try { + $this->db = new mysqli($this->dbhost, $this->dbuser, $this->dbpassword, $this->dbname); + } catch (Exception $e){ + echo $e->getMessage(); + exit; + } + } +} |
