예제 #1
0
 public static function getInstance()
 {
     if (self::$_db == null) {
         try {
             self::$_db = new PDO('mysql:host=' . self::DB_HOST . ';dbname=' . self::DB_NAME, self::DB_USER, self::DB_PASS);
         } catch (PDOException $e) {
             die('<h1>Sorry. The Database connection is temporarily unavailable.</h1>');
         }
         return self::$_db;
     } else {
         return self::$_db;
     }
 }