Calling methods from others classes
| From: | Ben Stones | Date: | Sun, 21 Sep 2008 13:55:12 +0000 |
| Subject: | Calling methods from others classes | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-280635@lists.php.net to get a copy of this message | ||
Hi,
I have this piece of code that I have created:
class userQueries {
public function numberUsers() {
$get_users=mysql_query("SELECT * FROM
users WHERE online <
NOW()") or exit("../includes/error.php");
}
}
class usersOnline extends userQueries {
public function usersOnline() {
echo mysql_num_rows($this->numberUsers);
}
}
How do I request specific methods in other classes? The error that comes up
is:
mysql_num_rows(): supplied argument is not a valid MySQL result resource
which is somewhat expected as $this only refers to the variables and there
are no variables called numberUsers.
Cheers!