diff --git a/web/admin.php b/web/admin.php
index f352ec185456d0c55eec654dab8f5934eebb2bab..1a7037deb222916dce0176e9d0e16ff10c3b1f63 100644
--- a/web/admin.php
+++ b/web/admin.php
@@ -1,8 +1,9 @@
 <?php
 session_start();
+include("include/config.php");
 require_once("classes/SQL.php");
 include("include/_head.php");
-include("include/config.php");
+
 
 $loggedIn = false;
 $loginFailed = true;
@@ -49,7 +50,7 @@ if (!$loggedIn){
 	</form>
 ';
 }else{
-	$sql = new SQL();
+	$sql = new SQL($DBHOST, $DBUSER, $DBPASS, $DBNAME);
 	$link = $sql->getLink();
 	$exist = false;
 
diff --git a/web/api/lastUpdate.php b/web/api/lastUpdate.php
index 5d9296a052a325c1c9d375941a7fa4f6b6f3e001..8468caf8155d1e286674fe12a93be16c21ce8f16 100644
--- a/web/api/lastUpdate.php
+++ b/web/api/lastUpdate.php
@@ -2,11 +2,10 @@
 
 
 if (isset($_POST["param"])){
-
-require_once("../classes/SQL.php");
 include("../include/config.php");
+require_once("../classes/SQL.php");
 
-	$sql = new SQL();
+	$sql = new SQL($DBHOST, $DBUSER, $DBPASS, $DBNAME);
 	$link = $sql->getLink();
 
 	$query = "SELECT ".$TBL_DATA.".id as id, ".$TBL_PARAMETER.".param as param, ".$TBL_DATA.".value as value, DATE_FORMAT(".$TBL_DATA.".timestamp, '%d.%m.%Y %H:%i:%s') as date FROM (".$TBL_REGISTER." INNER JOIN ".$TBL_PARAMETER." ON ".$TBL_REGISTER.".id = ".$TBL_PARAMETER.".fid_register) INNER JOIN ".$TBL_DATA." ON ".$TBL_PARAMETER.".id = ".$TBL_DATA.".fid_parameter WHERE ".$TBL_DATA.".fid_parameter = ".$_POST["param"]." ORDER BY ".$TBL_DATA.".id DESC LIMIT 1";
diff --git a/web/classes/SQL.php b/web/classes/SQL.php
index f34cc853e172a84ca803ba2fee5bd3ed8a2a3cb3..4affd4b58121823c8a185d459f5b911b54c3870c 100644
--- a/web/classes/SQL.php
+++ b/web/classes/SQL.php
@@ -1,15 +1,11 @@
 <?php
-
+	
 class SQL{
 
 	private $link;
-	private $dbHost = "localhost";
-	private $dbUser = "root";
-	private $dbPass = "";
-	private $dbName = "iot";
 
-	function __construct(){
-		$this->link = new mysqli($this->dbHost, $this->dbUser, $this->dbPass, $this->dbName);
+	function __construct($dbHost, $dbUser, $dbPass, $dbName){
+		$this->link = new mysqli($dbHost, $dbUser, $dbPass, $dbName);
 		$this->link->set_charset("utf8");
 	}
 
diff --git a/web/details.php b/web/details.php
index d30f56acc04287a6bdc74bc27576c4e168df7045..f039d444707941cbe9ccb6cd68ed29daeaa5fa45 100644
--- a/web/details.php
+++ b/web/details.php
@@ -1,11 +1,12 @@
 <?php
+include("include/config.php");
 require_once("classes/SQL.php");
 include("include/_head.php");
-include("include/config.php");
+
 ?>
 
 <?php
-$sql = new SQL();
+$sql = new SQL($DBHOST, $DBUSER, $DBPASS, $DBNAME);
 $link = $sql->getLink();
 
 if (isset($_GET["param"])){
diff --git a/web/graph.php b/web/graph.php
index 384738f4e68fc8aad69b557e78196a4f4342da64..afa18d528e137d17db7f892fdead1222e43a8fe9 100644
--- a/web/graph.php
+++ b/web/graph.php
@@ -1,8 +1,9 @@
 <?php // content="text/plain; charset=utf-8"
+require_once ('include/config.php');
 require_once ('classes/jpgraph/jpgraph.php');
 require_once ('classes/jpgraph/jpgraph_line.php');
 require_once ('classes/SQL.php');
-require_once ('include/config.php');
+
 
 if (isset($_GET["param"])){
 	if (isset($_GET["details"]) && $_GET["details"] == "yes"){
@@ -11,7 +12,7 @@ if (isset($_GET["param"])){
 		$showDetails = false;
 	}
 
-		$sql = new SQL();
+		$sql = new SQL($DBHOST, $DBUSER, $DBPASS, $DBNAME);
 		$link = $sql->getLink();
 
 		$dataY = array();
diff --git a/web/include/config.php b/web/include/config.php
index 858bd96f02c97318cedabee6432a72f632b4c614..5a3c6580b5f7d96f42f1360c15d9b4f73271ef31 100644
--- a/web/include/config.php
+++ b/web/include/config.php
@@ -1,19 +1,26 @@
 <?php
 
+// Database
 $TBL_PARAMETER = "tbl_parameter";
 $TBL_REGISTER = "tbl_register";
 $TBL_DATA = "tbl_data";
 $TBL_ADDRESSES = "tbl_addresses";
 $TBL_UNREGISTERED = "tbl_unregistered";
+$DBHOST = "localhost";
+$DBUSER = "root";
+$DBPASS = "";
+$DBNAME = "iot";
 
-$GRAPHPOINTS = -50;
-$THUMBSIZE = 4; // 1 min, 12 max
-$TABLELINESPERPAGE = 50;
+// Dashboard
+$DEVICEOFFLINETIME =  24; // Nach X Stunden Inaktivität vom Dashboard entfernen
+$REFRESHINTERVAL = 25; // Alle X Sekunden Daten im Dashboard neu laden
+$THUMBSIZE = 4; // Größe der Vorschaubilder - 1 min, 12 max
 
-// Wenn letzte Nachricht älter als X Stunden, wird das Gerät aus dem Dashboard entfernt
-$DEVICEOFFLINETIME =  24;
+// Graphs
+$GRAPHPOINTS = 50; // Anzahl der X letzten Messungen im Graphen
 
-$REFRESHINTERVAL = 25;
+// Details
+$TABLELINESPERPAGE = 50; // Anzahl der Tabelleneinträge pro Seite
 
 
 
@@ -21,4 +28,5 @@ $REFRESHINTERVAL = 25;
 
 $DEVICEOFFLINETIME = $DEVICEOFFLINETIME * 60;
 $REFRESHINTERVAL = $REFRESHINTERVAL * 1000;
+$GRAPHPOINTS = $GRAPHPOINTS * (-1);
 ?>
\ No newline at end of file
diff --git a/web/index.php b/web/index.php
index 524273886fb8b8e7fb9ba7ad6ee0ed6faa2402b8..02f7fea693cd8bea636294e9fbf849918f30dd72 100755
--- a/web/index.php
+++ b/web/index.php
@@ -1,7 +1,8 @@
 <?php
+include("include/config.php");
 require_once("classes/SQL.php");
 include("include/_head.php");
-include("include/config.php");
+
 ?>
 
 <!-- Page Header -->
@@ -13,7 +14,7 @@ include("include/config.php");
         </div>
 
 <?php
-$sql = new SQL();
+$sql = new SQL($DBHOST, $DBUSER, $DBPASS, $DBNAME);
 $link = $sql->getLink();
 $graphs = array();