Hello guys, i'm trying to show the full name of my user what is logged in. I am new to writing in oop. Im getting a undifined index fullname error. Can anyone help me?
/*** for showing the username or fullname ***/
public function get_fullname($userid)
{
$stmt = $this->db->prepare("SELECT fullname FROM users WHERE userid = $userid");
$stmt->execute();
/* Fetch all of the remaining rows in the result set */
$user_data = $stmt->fetchAll();
echo $user_data['fullname'];
}