Why is it become a problem? If you want to count result from your query, there is count() method from PHP, it's easy to use and don't have to create additional method in database result. Read example below:
PHP Code:
$query = $db->query("YOUR QUERY");
$numRows = count($query->getResult());
Is it not enough for you?