Advertisement
rifky_rep

database.php

Dec 2nd, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.54 KB | None | 0 0
  1. <?php
  2. class Database {
  3.     private $host;
  4.     private $user;
  5.     private $pass;
  6.     private $database;
  7.     public $conn;
  8.  
  9.     function __construct($host,$user,$pass,$database){
  10.         $this->host = $host;
  11.         $this->user = $user;
  12.         $this->pass = $pass;
  13.         $this->database = $database;
  14.  
  15.         $this->conn = new mysqli($this->host, $this->user, $this->pass, $this->database) or die (mysqli_error());
  16.         if(!$this->conn) {
  17.             return false;
  18.         }else{
  19.             return true;
  20.         }
  21.  
  22.     }
  23. }
  24.  
  25. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement