Error when counting grouped records

Im grouping my results and when i turn on the count feature i get this error. (my query is a mysql view using joins).

Cannot execute queries while other unbuffered queries are active. Consider using PDOStatement::fetchAll(). Alternatively, if your code is only ever going to run against mysql, you may enable query buffering by setting the PDO::MYSQL_ATTR_USE_BUFFERED_QUERY attribute.
select count(*) from orders_view_2 where producto = 'BARON B CHAMP EXTRA BRUT 750 CC. ’

Someone knows how to solve this? thx!