0
<?php

//Get ID
$category_id = filter_input(INPUT_POST, 'category_id', FILTER_VALIDATE_INT);

//Validate inputs
if ($category_id == null || $category_id == false) {

$error = "Invalid category ID.";

include('error.php');

} else {

require_once('database.php');
// Delete the product from the database


$query = 'DELETE FROM categories

              WHERE categoryID = :category_id';

$statement = $db->prepare($query);

$statement->bindValue(':category_id', $category_id);

$statement->execute();

$statement->closeCursor();

// Display the Category List page
**include('category_list.php');** 

** is line 32. I got error :

syntax error, unexpected end of file in D:\xampp\htdocs\ex_starts\ch04_ex1\delete_category.php

ADyson
  • 57,178
  • 14
  • 51
  • 63
Aileen
  • 11
  • 2
  • Looks like you forgot the closing `}` of the `else` – ADyson Sep 30 '21 at 23:30
  • 2
    For further info: [PHP parse/syntax errors; and how to solve them](https://stackoverflow.com/questions/18050071/php-parse-syntax-errors-and-how-to-solve-them) – ADyson Sep 30 '21 at 23:31

0 Answers0