Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Db_connect
- {
- private $host = "localhost";
- private $hostuser = "root";
- private $hostpass = "";
- public function __construct()
- {
- $this->conn = new PDO("mysql:host=$this->host;dbname=bank;charset=UTF-8", $this->hostuser, $this->hostpass);
- }
- public static function query(string $query)
- {
- $sql = $this->conn->prepare($query);
- $sql->execute->fetch();
- return $sql;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement