我让它像这个类一样工作:class useraccount{ private $username; 私人$姓氏;私人 $firstname;
public function userProfileView ()
{
$varViewUser = mysql_query("SELECT * FROM users");
$varusername = $_SESSION['username'];
$varViewUserProfile = mysql_query("SELECT * FROM users WHERE username = '$varusername'");
while ($rows = mysql_fetch_array($varViewUserProfile)) {
$this->username = $rows['username'];
$this->firstname = $rows['user_firstname'];
$this->lastname = $rows['user_lastname'];
$this->email = $rows['email'];
}
return $this->lastname;
return $this->firstname;
}
}
HTML:
名字:userProfileView(); ?>
现在我如何引用要显示的值?