This is my try statement
$query = "DELETEh FROM supers WHERE id = :id";
try {
$stmt = $conn->prepare($query);
$stmt->bindValue(':id', $id);
$stmt->execute();
$_SESSION['notification'] = "Hero was deleted sucessfully";
}
and this is the rest of the code
catch(PDOException $e) {
$_SESSION['notification'] = "There was an error deleting hero: " . $e->getMessage();
}
header("Location: notification.php");
exit;
when this runs, it tells me that the hero was deleted successfully, even though it did not because there is an extra "h" after DELETE. Could anyone explain why is this not getting into the catch block please?