Created
February 26, 2014 06:40
-
-
Save krisives/9224732 to your computer and use it in GitHub Desktop.
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
public function getPDO() { | |
if (isset($this->pdo)) { | |
return $this->pdo; | |
} | |
$this->pdo = new PDO( | |
"mysql:dbname=mtg", | |
'root', | |
'' | |
); | |
$this->pdo->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ); | |
$this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); | |
return $this->pdo; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment