View Single Post
Old 06-08-2009, 02:55 PM   #9 (permalink)
sketchMedia
The Prestige
Advanced Programmer Top Contributor Good Samaritan 
 
sketchMedia's Avatar
 
Join Date: Oct 2007
Location: Manchester, UK
Posts: 854
Thanks: 32
sketchMedia is on a distinguished road
Default

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)
sketchMedia is offline  
Reply With Quote
The Following User Says Thank You to sketchMedia For This Useful Post:
captainmerton (06-08-2009)