I have this class
class user{
public function getmsg(){
$sql3 = "SELECT * FROM news WHERE usertype = 'admin'";
$result = mysqli_query($this->db,$sql3);
while($user_data = mysqli_fetch_array($result)){
$whoposted = $user_data['whoposted'];
$dateposted = $user_data['dateposted'];
$title = $user_data['title'];
$content = $user_data['content'];
$whoposted = $user_data['usertype'];
}
}
}
assume that the object "db" has been declared. and my way of getting into the getmsg function is
$user = new user();
$user->getmsg();
now I want to get the content of $dateposted, how can i do that?
any help would be greatly appreciated. thank you.