query("SELECT id FROM users LIMIT 1"); if ($stmt->rowCount() === 0) { header('Location: register.php'); exit; } require_once 'includes/header.php'; $stmt = db()->query("SELECT posts.*, users.username FROM posts JOIN users ON posts.user_id = users.id ORDER BY posts.created_at DESC"); $posts = $stmt->fetchAll(); ?>
By on
Read More