0
votes

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?

1
If you do a var_dump() of the $activity variable once you have registered the class to it, what does it return? Also, have you ensured that the filepath to the PointsController() class, is the same on localhost and live? or that the live server is pointing to the correct file on your live system? - guyver4mk
When I do a var_dump() on $activity I 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

1 Answers

0
votes

Found it.

Apperantly I was uploading the files into the wrong folder. The old classes couldn't be overwritten this way. So it makes sence now.

Well, makes me to revise my folder structure...