Hi there,
Im wondering if any one can help with if possible a single SQL query
what i am trying to achieve is a count on the rows [name] only on active entries while also displaying only the single name.
Table
id name active
1 dog 1
2 dog 1
3 cat 1
4 frog 1
5 cat 0
6 dog 1
7 cat 1
results should look like this
dog 3
cat 2
frog 1
I have done this in other database programs but have not been able to achieve the same results with PHP and MySQL
Any Help would gratefully be received :-)
Im wondering if any one can help with if possible a single SQL query
what i am trying to achieve is a count on the rows [name] only on active entries while also displaying only the single name.
Table
id name active
1 dog 1
2 dog 1
3 cat 1
4 frog 1
5 cat 0
6 dog 1
7 cat 1
results should look like this
dog 3
cat 2
frog 1
I have done this in other database programs but have not been able to achieve the same results with PHP and MySQL
Any Help would gratefully be received :-)
Comment