class Forum
{
private $db;
public function __construct()
{
$this->db = new Database();
}
public function setStatusOne($question_id)
{
$sql = "UPDATE answers set status=:status WHERE question_id='" . $question_id . "' ";
$query = $this->db->pdo->prepare($sql);
$query->bindValue(':status', 0);
$query->execute();
$result = $query->fetchAll();
return $result;
}
}
<?php
$forum = new Forum();
$setStatusOne=$forum->setStatusOne($_GET['question_id']);
echo $setStatusOne;
?>