Welcome, !
My Enrolled Skills
You haven’t enrolled in any skills yet. Explore new skills to start learning!
Explore Skillsprepare("SELECT * FROM users WHERE id = ?"); $stmt->execute([$userId]); $user = $stmt->fetch(PDO::FETCH_ASSOC); if (!$user) { session_destroy(); header("Location: login.php"); exit; } // Fetch all skills $skills_by_category = []; $stmt = db()->query("SELECT * FROM skills ORDER BY category, title"); $all_skills = $stmt->fetchAll(PDO::FETCH_ASSOC); foreach ($all_skills as $skill) { $skills_by_category[$skill['category']][] = $skill; } // Fetch enrolled skills for the current user $stmt = db()->prepare(" SELECT s.id, s.title, s.category, s.thumbnail, e.progress FROM enrollments e JOIN skills s ON e.skill_id = s.id WHERE e.user_id = ? "); $stmt->execute([$userId]); $enrolled_skills = $stmt->fetchAll(PDO::FETCH_ASSOC); ?>
You haven’t enrolled in any skills yet. Explore new skills to start learning!
Explore Skills