假设与数据库的连接以及对表和单元格的所有引用都是正确的......我怎样才能得到这样的工作?
class User
{
private $_display;
private $_email;
public function __construct($username)
{
$fetch_user = mysql_query("SELECT * FROM `registered_users` WHERE `user_name`='$username'");
$fetch_user = mysql_fetch_array($fetch_user);
$this->_display = $fetch_user['user_display'];
$this->_email = $fetch_user['user_email'];
}
}
$person1 = new User('username');
echo "Information: " . print_r($person1, TRUE);
问题是它什么也不返回。调试时不会抛出错误或任何东西。这是可行的方法吗?:S