Guest User

Untitled

a guest
Sep 23rd, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. <?php
  2. //inside helpers/Settings.php class
  3. public function db() {
  4. if ($this->db == null) {
  5. $server = "localhost";
  6. $user = "root";
  7. $pass = "";
  8. $dbName = "test";
  9. $this->db = new mysqli($server, $user, $pass, $dbName);
  10. }
  11. return $this->db;
  12. }
  13.  
  14. //at the bottom of helpers/Settings.php file
  15. function db(){
  16. global $config;
  17. return $config->db();
  18. }
Add Comment
Please, Sign In to add comment