Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Database
- {
- private static $_connection = null;
- private function __construct() {
- $_connection = new PDO($dsn, $user, $pass);
- }
- public static function getDB() {
- if($_connection == null) {
- $_connection = new Database();
- }
- return $_connection;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement