diff options
| author | ilotterytea <iltsu@alright.party> | 2025-04-20 16:06:19 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-04-20 16:06:19 +0500 |
| commit | 5fc857449011f76ed7677aad40576790310d23e1 (patch) | |
| tree | a8bbff085c1cd83d5070c1bf4c013e79cfe8f938 /public/index.php | |
| parent | 10cde47798f2a7b10a84a22f53aeddab1ceea720 (diff) | |
feat: moved from SQLite to MySQL
Diffstat (limited to 'public/index.php')
| -rw-r--r-- | public/index.php | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/public/index.php b/public/index.php index 14d2c9a..5619208 100644 --- a/public/index.php +++ b/public/index.php @@ -1,3 +1,6 @@ +<?php +include_once "../src/config.php"; +?> <html> <head> @@ -25,11 +28,9 @@ <div class="counter"> <?php - $db = new SQLite3("../database.db"); + $db = new PDO(DB_URL, DB_USER, DB_PASS); $results = $db->query("SELECT COUNT(*) FROM emotes"); - $count = $results->fetchArray()[0]; - - $db->close(); + $count = $results->fetch()[0]; foreach (str_split($count) as $c) { echo "<img src=\"/static/img/counter/$c.png\" alt=\"\" />"; |
