1
0

Show admin page even without db connection

This commit is contained in:
2019-12-28 23:52:19 +01:00
parent d0aea4e4e7
commit 3f4cc7875d
8 changed files with 101 additions and 38 deletions

View File

@@ -21,6 +21,16 @@ class Database
self::$PDO = new PDO($dsn, $CONFIG['user'], $CONFIG['password'], $opt);
}
public static function tryconnect()
{
try {
self::connect();
return true;
} catch (exception $e) {
return false;
}
}
public static function sql_query_num($query)
{
$r = self::$PDO->query($query)->fetch(PDO::FETCH_NUM)[0];