Better structure

This commit is contained in:
Kilian Kurt Hofmann
2024-04-26 11:54:36 +02:00
parent 8b41f907e2
commit 09ad98ba14
6 changed files with 62 additions and 20 deletions
+8 -7
View File
@@ -1,10 +1,10 @@
<?php
include_once 'database.php';
include_once "errors.php";
include_once "headers.php";
Headers::json();
include_once "database.php";
ini_set(display_errors, 1);
error_reporting(E_ALL);
$db = openConnection();
$db = DB::openConnection();
$query = "SELECT * FROM users";
@@ -12,5 +12,6 @@ $stmt = $db->prepare($query);
$stmt->execute();
$result = $stmt->fetch(PDO::FETCH_ASSOC);
echo json_encode($result);
?>
DB::closeConnection($db);
echo json_encode($result);