Corrected error that occured after splitting config into separate file.

This commit is contained in:
Jens 2021-02-05 21:46:17 +01:00
parent 86cb486637
commit 0fc03a39e0
2 changed files with 11 additions and 9 deletions

View File

@ -1,16 +1,16 @@
<?php <?php
require_once("shoppingListConfig.php");
class DBLink class DBLink
{ {
require_once("shoppingListConfig.php");
static $sqlLink = null; static $sqlLink = null;
public static function getDbLink() public static function getDbLink()
{ {
if(DBLink::$sqlLink == null) if(DBLink::$sqlLink == null)
{ {
DBLink::$sqlLink = new mysqli(DBLink::$mysqlserver, DBLink::$mysqluser, DBLink::$mysqlpw, DBLink::$mysqldb, DBLink::$mysqlPort); DBLink::$sqlLink = new mysqli(Configuration::$mysqlserver, Configuration::$mysqluser, Configuration::$mysqlpw, Configuration::$mysqldb, Configuration::$mysqlPort);
// Verbindung überprüfen // Verbindung überprüfen
if (mysqli_connect_errno()) if (mysqli_connect_errno())

View File

@ -1,9 +1,11 @@
<?php <?php
static $mysqlserver = 'mysql.mydomain'; //Host class Configuration
static $mysqluser = 'shoppingList'; //User [It's recommended to not use root] {
static $mysqlpw = 'somePassword'; //Password public static $mysqlserver = 'mysql.mydomain'; //Host
static $mysqldb = 'shoppingList'; //Database public static $mysqluser = 'shoppingList'; //User [It's recommended to not use root]
static $mysqlPort = 3306; public static $mysqlpw = 'somePassword'; //Password
public static $mysqldb = 'shoppingList'; //Database
public static $mysqlPort = 3306;
}
?> ?>