I'm watching a tutorial I'm trying to delete a specific section By Id , I'm getting Error Processing Request which is my error exception in my model and if i var_damp my query it returns Boolean false idk why this not working.
model
public function deletesec($id)
{
// Delete a specific section.
$query = "DELETE * FROM $this->tablename WHERE id = '$id'";
if (!$sqli = mysqli_query($this->cxn->connect(),$query)) {
var_dump($sqli);
throw new Exception("Error Processing Request");
} else
echo "Done";
}
controller
try
{
//Display all data.
require_once '../model/cone.php';
require_once '../model/display.php';
$display = new Display("sections");
$data = $display->getSections();
//Delete a specific section By Id.
if(isset($_GET['deleteid']))
{
$id = $_GET['deleteid'];
require_once '../model/dsections.php';
$delete = new Dsections("sections");
$delete->deletesec($id);
}
//my view.
require_once '../view/vsections.php';
}