So far I know that $this-> is used in object programming to access methods and properties of current object. But why $this-> is not used also for $q in the following code. When exactly do we need to put $this->?
$username = addslashes($username);
$q = "SELECT username FROM ".TBL_USERS." WHERE username = '$username'";
$result = mysql_query($q, $this->connection);
return (mysql_numrows($result) > 0);