In my case I have this function:
in the Home file well at the beginning I imported here:
<?php
require_once("session.php");
require_once("class_usuario.php");
$auth_user = new USER();
$user_id = $_SESSION['user_session'];
$stmt = $auth_user->runQuery("SELECT * FROM N00_Usuario WHERE idUsuario=:user_id");
$stmt->execute(array(":user_id"=>$user_id));
$userRow=$stmt->fetch(PDO::FETCH_ASSOC);
?>
e no arquivo Home importei a classe que está dentro do arquivo Class_usuario:
<?php
require_once("session.php");
require_once("class_usuario.php");
$auth_user = new USER();
$user_id = $_SESSION['user_session'];
$stmt = $auth_user->runQuery("SELECT * FROM N00_Usuario WHERE idUsuario=:user_id");
$stmt->execute(array(":user_id"=>$user_id));
$userRow=$stmt->fetch(PDO::FETCH_ASSOC);
?>
<div class="box bg-primary">
<i class="fa fa-eye"></i>
<?php
try{
$a= ContaUsuario($connection) ;
}
catch(PDOException $e) {
echo "Error: " . $e->getMessage();
}
?>
<h3><?php echo $a;?></h3>
<p class="lead">Page views</p>
</div>
</div>
What's wrong? Anyone have an idea?