$query = "SELECT * FROM categories";
$select_categories = mysqli_query($connection, $query);
while ($row = mysqli_fetch_assoc($select_categories)) {
$cat_id = $row['cat_id'];
$cat_title = $row['cat_title'];
echo "<tr>";
echo "<td>{$cat_id}</td>";
echo "<td>{$cat_title}</td>";
echo "<td><a href='categories.php?delete={$cat_id}'>Delete</a></td>";
echo "</tr>";
}
?>
<?php
//DELETE QUERY;
if(isset($_GET['detele'])) {
$the_cat_id = $_GET['delete'];
$query = "DELETE FROM categories WHERE cat_id = {$the_cat_id} ";
$delete_query = mysqli_query($connection,$query);
header("Location: categories.php");
}
?>
So, I have this page that is showing me every single item (category) from my database, and I have them sorted by id and everything works just fine except only one thing. When I try to delete an item, nothing happens. The thing is I have no errors and that is making me wander why is not working.