Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(!defined('MYSQL')) {
- define ('MYSQL', true);
- class MySQL {
- private static $m_pInstance;
- private function __construct() {}
- // Singleton
- public static function getInstance() {
- if (!self::$m_pInstance)
- {
- self::$m_pInstance = new PDO('mysql:host=localhost;dbname=database', 'user', 'password', array(PDO::ATTR_PERSISTENT => true));
- }
- return self::$m_pInstance;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement