aboutsummaryrefslogtreecommitdiff
path: root/backend/index.php
diff options
context:
space:
mode:
authorhitlerrip <git@hitler.rip>2025-07-29 19:17:50 +0200
committerhitlerrip <git@hitler.rip>2025-07-29 19:17:50 +0200
commit3c0ebfbbcd9d41b936ede928af05db9f15733d1a (patch)
tree0cfda95dd3525debbda0e0b4ece13501b5d81f48 /backend/index.php
downloadhitler-clicker-3c0ebfbbcd9d41b936ede928af05db9f15733d1a.tar.gz
hitler-clicker-3c0ebfbbcd9d41b936ede928af05db9f15733d1a.tar.bz2
hitler-clicker-3c0ebfbbcd9d41b936ede928af05db9f15733d1a.zip
init
base to build this game off of
Diffstat (limited to 'backend/index.php')
-rw-r--r--backend/index.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/backend/index.php b/backend/index.php
new file mode 100644
index 0000000..dead696
--- /dev/null
+++ b/backend/index.php
@@ -0,0 +1,17 @@
+<?php
+header('Content-Type: application/json; charset=UTF-8');
+
+try {
+ $pdo = new PDO("mysql:host=127.0.0.1;dbname=hitlerclicker", "root", "aA1234Aa");
+} catch(PDOException $e) {
+ die('{ "status": "database offline" }');
+};
+
+$query = $pdo->prepare("CREATE TABLE IF NOT EXISTS `hitlerclicker`.`stats` ( `team` VARCHAR(256) NOT NULL DEFAULT uuid() , `clicks` INT(128) unsigned zerofill NOT NULL DEFAULT '0', PRIMARY KEY (`team`) ) ENGINE = InnoDB;");
+$query->execute();
+$query = $pdo->prepare("CREATE TABLE IF NOT EXISTS `hitlerclicker`.`users` ( `name` VARCHAR(256) NOT NULL DEFAULT uuid() , `password` VARCHAR(256) NOT NULL , `team` VARCHAR(256) NOT NULL DEFAULT 'axis' , `clicks` INT(128) unsigned zerofill NOT NULL DEFAULT '0', PRIMARY KEY (`name`) ) ENGINE = InnoDB;");
+$query->execute();
+
+echo '{ "status": "online" }';
+
+?>