Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Database
- {
- private static $datasource = 'mysql:host=localhost; dbname=mydbname';
- private static $username = 'root';
- private static $password = 'root';
- private static $pdo;
- public static function getPDO()
- {
- if (!isset(self::$db)) {
- self::$pdo = new PDO(self::$datasource, self::$username, self::$password);
- }
- return self::$pdo;
- }
- }
Add Comment
Please, Sign In to add comment