Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Counting number of columns with the same number

$
0
0

Hello, I can't seem to be able to count the number of rows that have the same numbers.
 
For example, in column forums_id, if the column contains 3 then count all of them with the number 3. If column contains then count all of them with the numbers 2. Here is what I mean.
 
count_rowsfw_zpsd4dc0170.png
 
Is there a way to do that? I've got something like this.

SELECT count(*) as forums_counting FROM forums_comment WHERE forums_id = '$forums_id' GROUP BY forums_id

Viewing all articles
Browse latest Browse all 13200

Trending Articles