My local server can find the controller class, but once live I get the following error:
Fatal error: call to undefined method getMyLogs();
To access the method I do the following:
$activity = new PointsController();
$logs = $activity->getMyLogs($_SESSION['id']);
Now the method itself:
public function getMyLogs($id)
{
$db = new DB();
$sql = 'SELECT * FROM `users_activity` WHERE `user_id` = :user_id ORDER BY `log_date` DESC';
$results = $db->get($sql, array(
':user_id' => $id
));
return $results;
}
As said, it is working like a charm on my localhost. Once I upload it live the server respond with the error I mentioned.
How is this possible? What am I doing wrong?
var_dump()of the$activityvariable once you have registered the class to it, what does it return? Also, have you ensured that the filepath to thePointsController()class, is the same on localhost and live? or that the live server is pointing to the correct file on your live system? - guyver4mkvar_dump()on$activityI get the following:object(PointsController)[10]. Yes it is autoloaded. Another class is called in a div above, so it should work.. But it doens't -.- - Jeroen Bellemans