Example #1
0
    public static function connect()
    {
        global $config;
        try {
            self::$pdo = new PDO($config["db"]["dsn"], $config["db"]["user"], $config["db"]["pass"]);
        } catch (PDOException $e) {
            ?>
			<h1>Database connection failure</h1>
			<p>
				Please ensure the database settings in config.php are correct.
			</p>
			<?php 
            exit;
        }
    }