lukas
7b044f97b8
set html title poll infos about current reindex better hover effect of preview tiles hide non existing infos in Player fixed wrong tagging of lq resolutions
42 lines
1007 B
PHP
42 lines
1007 B
PHP
<?php
|
|
|
|
class Database
|
|
{
|
|
private static ?Database $instance = null;
|
|
private mysqli $conn;
|
|
|
|
private string $servername = "192.168.0.30";
|
|
private string $username = "root";
|
|
private string $password = "1qayxsw2";
|
|
private string $dbname = "hub";
|
|
|
|
// The db connection is established in the private constructor.
|
|
private function __construct()
|
|
{
|
|
// Create connection
|
|
$this->conn = new mysqli($this->servername, $this->username, $this->password, $this->dbname);
|
|
|
|
if ($this->conn->connect_errno) {
|
|
echo "connecton failed... nr: " . $this->conn->connect_errno . " -- " . $this->conn->connect_error;
|
|
}
|
|
}
|
|
|
|
public static function getInstance()
|
|
{
|
|
if (!self::$instance) {
|
|
self::$instance = new Database();
|
|
}
|
|
|
|
return self::$instance;
|
|
}
|
|
|
|
public function getConnection()
|
|
{
|
|
return $this->conn;
|
|
}
|
|
|
|
public function getDatabaseName(){
|
|
return $this->dbname;
|
|
}
|
|
}
|