prepare("DELETE FROM tenants WHERE id = :id"); $stmt->bindParam(':id', $id, PDO::PARAM_INT); $stmt->execute(); if ($stmt->rowCount() > 0) { header('Location: index.php?tab=tenants&status=deleted'); } else { header('Location: index.php?tab=tenants&error=NotFound'); } exit; } catch (PDOException $e) { header('Location: index.php?tab=tenants&error=' . urlencode($e->getMessage())); exit; } ?>