How to get the total number of rows of a GROUP BY query?
The method I ended up using is very simple:
$query = 'SELECT a, b, c FROM tbl WHERE oele = 2 GROUP BY boele';$nrows = $db->query("SELECT COUNT(1) FROM ($query) x")->fetchColumn();
Might not be the most efficient, but it seems to be foolproof, because it actually counts the original query's results.