我如何在课堂外访问 $pos var?所以我可以在我的索引中使用它,例如: echo $pos 我也在我的索引中包含了这个类。
public function CheckProfile(){
$get = $this->db->query("SELECT positive, posts FROM users WHERE user='". $_SESSION['user'] ."'");
while($row = $get->fetch(PDO::FETCH_ASSOC))
{
return $pos = $row['post'];
}
}