LPH
Well-known member
This is going to read as "a really stupid question." I apologize because my eyes are blurry and my mind is super numb. Regardless, would someone please look at the following code and nudge me in the right direction.
This gives the array in the array ...
Now, I'm stuck on the echo statement. The answer is staring me in the face (the print_r) but the head smack isn't there
I realize this is wrong.
So, what is the best way to return that "total" ?
And - while you are smacking me for being silly - is there a better way to return the number of online guests? Did I miss a function already in XenForo?
Code:
$query_count = 'SELECT COUNT(*) as total FROM `xf_session`';
$query_count_total = XenForo_Application::get( 'db' )->fetchAll( $query_count );
print_r($query_count_total);
This gives the array in the array ...
Code:
Array ( [0] => Array ( [total] => 3 ) )
Now, I'm stuck on the echo statement. The answer is staring me in the face (the print_r) but the head smack isn't there
I realize this is wrong.
Code:
echo $query_count_total['total'];
So, what is the best way to return that "total" ?
And - while you are smacking me for being silly - is there a better way to return the number of online guests? Did I miss a function already in XenForo?