Código:
class Login { private $us_nick; private $query; public function __construct($username){ $this->us_nick = $username; $this->query = mysql_query("SELECT * FROM usuarios WHERE us_nick = '".$this->us_nick."'"); $this->numrows = mysql_num_rows($this->query); if ($this->us_nick) { if ($this->numrows == 0) { }else{ $_SESSION['user'] = $this->us_nick; } } } }