0
How do I do echo
of counting the result of the following function?
public function get_Myinteresses()
{
global $db;
$myInteresses = array();
$get_interids = $db->query(sprintf("SELECT * FROM inter_user_conn WHERE iduser = %s", secure($this->_data['user_id'], 'int'))) or _error(SQL_ERROR_THROWEN);
if($get_interids->num_rows > 0)
{
while($interids = $get_interids->fetch_assoc())
{
$nterid = $interids['idinter'];
$get_Myinteresses = $db->query(sprintf("SELECT * FROM inter_list WHERE idinter = %s", secure($nterid, 'int') )) or _error(SQL_ERROR_THROWEN);
if($get_Myinteresses->num_rows > 0)
{
while($minteresse = $get_Myinteresses->fetch_assoc())
{
$myInteresses[] = $minteresse;
}
}
}
}
return $myInteresses;
}
Tries
echo count(get_Myinteresses());
– Sam
No! Something like that? public Function countMyint(){ $countMyinter = Count(get_Myinteresses(); Return $countMyinter; }
– Bruno Serrano