Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include('../configs/config.global.php');
- class Database {
- var $host;
- var $user;
- var $pass;
- var $db;
- var $con;
- function __construct(){
- global $mysql_host;
- global $mysql_user;
- global $mysql_pass;
- global $mysql_db;
- $this->host = $mysql_host;
- $this->user = $mysql_user;
- $this->pass = $mysql_pass;
- $this->db = $mysql_db;
- $this->con = mysqli_connect($this->host, $this->user, $this->pass) or die(mysql_error($this->con));
- mysqli_select_db($this->db, $this->con) or die(mysql_error($this->con));
- }
- public function Query($sql){
- return mysqli_query($this->con, $sql);
- }
- function __destruct(){
- mysqli_close($this->con);
- }
- }
- ?>
Add Comment
Please, Sign In to add comment