Created
April 5, 2012 09:04
-
-
Save dustinlakin/2309349 to your computer and use it in GitHub Desktop.
Settings Database
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment