duancuan6466
2016-05-22 17:21
浏览 43
已采纳

致命错误:调用未定义的方法getMyLogs()

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条回答 默认 最新

  • drudmb2594 2016-05-22 20:31
    已采纳

    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...

    已采纳该答案
    打赏 评论

相关推荐 更多相似问题