prepare("DELETE FROM functions WHERE id = :id"); $stmt->execute(['id' => $id]); // Optional: Also delete user_functions associated with this function $stmt = $pdo->prepare("DELETE FROM user_functions WHERE function_id = :function_id"); $stmt->execute(['function_id' => $id]); header('Location: functions.php'); exit();