I have code this on the Global Code (userfn)
$sql_online = "SELECT COUNT(*) AS totalFROM visitor WHERE visit_time > (NOW() - INTERVAL 5 MINUTE)";
$online_result= ExecuteQuery($online_sql);
$online_total = $online_result->fetch_assoc()['total'];
error userfn.php(218): Call to undefined method Doctrine\DBAL\ForwardCompatibility\Result::fetch_assoc()