Undefined variable: id, i tested the id by eachoing it and it worked so how it's Undefined
mycontroller
if(isset($_GET['deleteid']))
{
$id = $_GET['deleteid'];
require_once '../model/dsections.php';
$delete = new Dsections("sections");
$delete->deletesec($id);
require_once '../view/vsections.php';
}
model
class Dsections extends cone{
protected $tablename;
public function __construct($tablename)
{
//DB table name.
$this->tablename = $tablename;
//DB connection.
$this->connectTodb();
//Delete function
$this->deletesec($id);
}
public function deletesec($id)
{
// Delete a specific section.
$query = "DELETE * FROM $this->tablename WHERE id = $id ";
if (!$sqli = mysqli_query($this->cxn->connect(),$query)) {
throw new Exception("Error Processing Request");
}
}
} the error at this line in mymodel $this->deletesec($id);