I have the function:
function get_current_users($current_users)
{
global $db;
$current_users = $db->EscapeString($current_users);
$total_current_users = $db->QueryFetchArray("SELECT COUNT(*) FROM users AS total_current_users");
return $total_current_users['total_current_users'];
}
But I have no clue how to output the result, I’ve tried the following options but nothing displays:
`<?$total_current_users?>
<?['$total_current_users']?>
<?=data['$total_current_users']?>`
If you are certain that your function does what it’s supposed to, I guess the two equivalent methods would gain you the output:
<?= get_current_users() ?>or<?php echo get_current_users() ?>As a note: I don’t see the point of your argument
$current_usersthat you escape — because it never gets use in the subsequent query.