diff --git a/api.php b/api.php index 6d316c9..6623189 100644 --- a/api.php +++ b/api.php @@ -82,6 +82,19 @@ ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;"); } + if(!in_array("counter", $tables)) { + query("CREATE TABLE `counter` ( + `value` int NOT NULL, + PRIMARY KEY (`value`) + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;"); + } + + query("SELECT COUNT(value) AS count FROM counter;", function($row) { + if($row["count"] <= 0) { + query("INSERT INTO counter(value) VALUES (0);"); + } + }); + if(isset($_GET["cmd"])) { $cmd = $_GET['cmd']; diff --git a/counter.php b/counter.php new file mode 100644 index 0000000..2b150f6 --- /dev/null +++ b/counter.php @@ -0,0 +1,32 @@ + + + + + Vkládání otázek + + +

Počítadlo

+

+ Je tu + + lidí! +

+
+ + +
+ + +