Jump to content

Recommended Posts

Posted

Hello,

I'm getting an error:

Dangit… Fatal Error: Uncaught Error: Class "SessionHandlerDB" not found in site/templates/content.php:2320

The error is pointing to a function:

function onlineUserIDs($mins, $limit = 500) {
    $table = SessionHandlerDB::dbTableName;
    $seconds = $mins * 60;
    $sql =  "SELECT user_id " .
        "FROM `$table` " .
        "WHERE ts > DATE_SUB(NOW(), INTERVAL $seconds SECOND) " .
        "AND user_id!=40 " . // exclude guest
        "ORDER BY ts DESC LIMIT $limit";
    $query = wire('database')->prepare($sql);
    $query->execute();
    $results = $query->fetchAll(\PDO::FETCH_COLUMN);
    return $results;
}

This isn't my code so i'm struggling a bit to wrap my head around it do any of you have an ideas?

Thanks,

Mark.

Posted

Does content.php have namespaces? I also randomly sometimes get these errors, I think it has something to do with the ProcessWire FileCompiler, using namespaces everywhere reduces the chance of this happening. 

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...