prepare("UPDATE exercises SET name = ?, description = ?, video_url = ?, muscle_group = ? WHERE id = ?"); $stmt->execute([$name, $description, $video_url, $muscle_group, $id]); } header("Location: admin_exercises.php"); exit; } // Fetch the exercise $stmt = db()->prepare("SELECT * FROM exercises WHERE id = ?"); $stmt->execute([$id]); $exercise = $stmt->fetch(); if (!$exercise) { header("Location: admin_exercises.php"); exit; } ?>