diff --git a/private/mysql_connect.php b/private/mysql_connect.php deleted file mode 100644 index 5969e28..0000000 --- a/private/mysql_connect.php +++ /dev/null @@ -1,38 +0,0 @@ -host = $config['host']; - $this->port = parse_ini_file($_SERVER['DOCUMENT_ROOT'].'/../env_config.ini')['local_mysql_port']; - $this->user = $config['username']; - $this->pass = $config['password']; - $this->createConn(); - } - - private function createConn() { - $this->mysqli = new mysqli($this->host . ":" . $this->port, $this->user, $this->pass, $this->dbName); - } - - public function query($sql) { - return $this->mysqli->query($sql); - } - - public function changeDB($dbName) { - $this->dbName = $dbName; - $this->mysqli->select_db($dbName); - } - - public function __destruct() { - $this->mysqli->close(); - } - -} \ No newline at end of file diff --git a/public/index.html b/public/index.html deleted file mode 100644 index 01e5133..0000000 --- a/public/index.html +++ /dev/null @@ -1,22 +0,0 @@ - - - - - - - - - - - Benjamin Kraft: Games - - -
-

Benjamin Kraft: Games

-
-

Hi, here you can find some games I wrote with Javascript, Typescript or C#

-
-
-
- - \ No newline at end of file diff --git a/public/index.php b/public/index.php new file mode 100644 index 0000000..299842b --- /dev/null +++ b/public/index.php @@ -0,0 +1,43 @@ + + + + + + + + Benjamin Kraft: Games + + +
+

Benjamin Kraft: Games

+
+

Hi, here you can find some games I wrote with Javascript, Typescript or C#

+
+
+ query("SELECT * FROM projects WHERE visible=1"); + while ($row = $result->fetch_assoc()){ + $name = $row["name"]; + + $displayName = $row["display_name"]; + $info = $row["info"]; + $version = $row["version"]; + $path = $row["path"]; + + $nameDom = "

$displayName

"; + $versionDom = "

$version

"; + $infoDom = "
$info
"; + $startDom = ""; + + $img = ""; //TODO get img from database + $description = "
$nameDom$versionDom$infoDom$startDom
"; + + echo "
$img$description
"; + } + ?> +
+
+ + \ No newline at end of file diff --git a/public/php/mysql_connect.php b/public/php/mysql_connect.php new file mode 100644 index 0000000..9bacb2f --- /dev/null +++ b/public/php/mysql_connect.php @@ -0,0 +1,38 @@ +host = 'localhost'; + $this->port = $env['MYSQL_PORT']; + $this->user = $env['MYSQL_USER']; + $this->pass = $env['MYSQL_PASSWORD']; + $this->createConn(); + } + + private function createConn(): void { + $this->mysqli = new mysqli($this->host . ":" . $this->port, $this->user, $this->pass, $this->dbName); + } + + public function query($sql): mysqli_result|bool { + return $this->mysqli->query($sql); + } + + public function changeDB($dbName): void { + $this->dbName = $dbName; + $this->mysqli->select_db($dbName); + } + + public function __destruct() { + $this->mysqli->close(); + } + +} \ No newline at end of file