summaryrefslogtreecommitdiff
path: root/public_html/class/mysql.php
blob: b2d29830c46ab92b7efd05d1f16ae1d2b303c4a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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;
		}
	}
}