public static function getDB() { if (!isset(self::$db)) { try { self::$db = new PDO(self::$dsn, self::$username, self::$password); } catch (PDOException $e) { self::$error_msg = $e->getMessage(); include 'views/db_error.php'; exit; } } return self::$db; }
public static function getDB() { if (!isset(self::$db)) { try { self::$db = new PDO(self::$dsn, self::$username, self::$passwd); } catch (PDOException $ex) { $error_message = $ex->getMessage(); include '../errors/datebase_error.php'; exit; } } return self::$db; }