Browse Source

Corrected error that occured after splitting config into separate file.

development
Jens 1 year ago
parent
commit
0fc03a39e0
  1. 6
      phpInterface/shoppingList.php
  2. 14
      phpInterface/shoppingListConfig.php

6
phpInterface/shoppingList.php

@ -1,16 +1,16 @@
<?php
require_once("shoppingListConfig.php");
class DBLink
{
require_once("shoppingListConfig.php");
static $sqlLink = null;
public static function getDbLink()
{
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
if (mysqli_connect_errno())

14
phpInterface/shoppingListConfig.php

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