PHP Ecom Part 11 : How to delete category in PHP MySQL | Delete image after deleting category

preview_player
Показать описание
In this video, you will learn how to delete category in PHP MySQL. We will delete the category image after deleting category data from our database.

PHP Ecom Part 10 : How to edit and update category in PHP MySQL

If the video helps you, hit the like button and subscribe to the channel. If you have any doubts or suggestions, drop them in the comments below and i will answer them.
Thanks for watching

Рекомендации по теме
Комментарии
Автор

Very Nice video ! Thanks again so helpfull!

roskowasilev
Автор

Why is the image not getting deleted in my upload folder?

else
{
$category_id = mysqli_real_escape_string($con, $_POST['category_id']);

$category_query = "SELECT * FROM categories WHERE id='category_id'";
$category_query_run = mysqli_query($con, $category_query);
$category_data =
$image = $category_data['image'];

$delete_query = "DELETE FROM categories WHERE id='$category_id'";
$delete_query_run = mysqli_query($con, $delete_query);

if($delete_query_run)
{

{

}

redirect("category.php", "Category deleted successfully.");
}
else
{
redirect("category.php", "Failed to delte category.");
}
}

jhaymharlonborbon