PHP-Course/index.php
Kilian Kurt Hofmann 8b41f907e2 File structure
2024-04-26 11:22:20 +02:00

16 lines
268 B
PHP

<?php
include_once 'database.php';
ini_set(display_errors, 1);
error_reporting(E_ALL);
$db = openConnection();
$query = "SELECT * FROM users";
$stmt = $db->prepare($query);
$stmt->execute();
$result = $stmt->fetch(PDO::FETCH_ASSOC);
echo json_encode($result);
?>