Let say that we have the following query:
SELECT DISTINCT COUNT(`users_id`) FROM `users_table`;
this query will return the number of the us
Also, an alternative using mysqli, which you should be using anyway for parameter interpolation:
$statement = $connection->prepare($the_query_from_above); $statement->execute(); $statement->bind_result($nr_of_users); $statement->fetch();