Advertisement
Guest User

Untitled

a guest
Nov 7th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.46 KB | None | 0 0
  1. <?php
  2.  
  3. class Db_connect
  4. {
  5.  
  6.     private $host = "localhost";
  7.     private $hostuser = "root";
  8.     private $hostpass = "";
  9.  
  10.     public function __construct()
  11.     {
  12.         $this->conn = new PDO("mysql:host=$this->host;dbname=bank;charset=UTF-8", $this->hostuser, $this->hostpass);
  13.     }
  14.  
  15.     public static function query(string $query)
  16.     {
  17.         $sql = $this->conn->prepare($query);
  18.         $sql->execute->fetch();
  19.  
  20.         return $sql;
  21.     }
  22.  
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement