I need to return the total number of records in a field of a table, and also count the number of records of a given id.
I need to count the data of a poll's table of votes so I need to count the values of a field to calculate the percentage.
In the votes table I have the field id
and the field opcao
where it shows the example options: good, bad, great.
I need to count how many votes I have in the total of all the options and also count how many votes I have in each opcao
.
How do I do this in Doctrine?