06-08-2009, 02:55 PM
|
#9 (permalink)
|
|
The Prestige
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
|
That is because you have not instantiated the object, therefore $this will never contain the reference to the calling object (as it doesn't exist) instead you are using a static call to a class method (which in your case isn't declared static which is bad practice).
You would need something like this:
PHP Code:
$tblWriter = new OnlineNowTable(); //create a new object $tblWriter->writeTable($_SESSION['name']); //run the writeTable method
But looking at your code, I think you need it like this:
PHP Code:
$tblWriter = new OnlineNowTable($_SESSION['name']); //create a new object $tblWriter->writeTable(); //run the writeTable method
__________________
mysql> SELECT * FROM `users` WHERE `users`.`clue` > 0;
Empty set (0.00 sec)
|
|
|
|