Guest User

Untitled

a guest
Jun 22nd, 2018
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.86 KB | None | 0 0
  1. <?php
  2. require_once('system/class.mysql_config.php');
  3. class HRF_MySQLi extends mysql_config
  4. {
  5.     private $connection;
  6.     private static $m_pInstance;
  7.  
  8.     public $db_host;
  9.     public $db_user;
  10.     public $db_pass;
  11.     public $db_name;
  12.    
  13.     public function __construct()
  14.     {
  15.         //echo "Constructor called<br />\n";
  16.         $this->db_host = $this->config_mysql_host;
  17.         $this->db_user = $this->config_mysql_user;
  18.         $this->db_pass = $this->config_mysql_pass;
  19.         $this->db_name = $this->config_mysql_name;
  20.        
  21.         //connectie maken
  22.         $this->connection = new mysqli($this->db_host,$this->db_user,$this->db_pass,$this->db_name);
  23.         if (mysqli_connect_errno()) {
  24.             printf("Kan niet connecteren met MySQL Server. Errorcode: %s <br />", mysqli_connect_error());
  25.             exit;
  26.         }
  27.        
  28.         //encoding op UTF-8 zetten
  29.         $this->connection->query("SET NAMES 'utf8'");
  30.        
  31.         return $this->connection;
  32.     }
  33. }
Add Comment
Please, Sign In to add comment