Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- //inside helpers/Settings.php class
- public function db() {
- if ($this->db == null) {
- $server = "localhost";
- $user = "root";
- $pass = "";
- $dbName = "test";
- $this->db = new mysqli($server, $user, $pass, $dbName);
- }
- return $this->db;
- }
- //at the bottom of helpers/Settings.php file
- function db(){
- global $config;
- return $config->db();
- }
Add Comment
Please, Sign In to add comment