Forum Moderators: coopster & phranque

Message Too Old, No Replies

Counting amount of rows for a field within mysql query

         

foy

9:23 pm on Dec 26, 2002 (gmt 0)

10+ Year Member



I have a mysql table with a field called "id". "Id" is not unique, an integer and I would like to count the amount of rows having this "id" using PHP.

the html output should look like this:


<? echo amount of rows where id == 1?> rows have "id" == 1
<? echo amount of rows where id == 2?> rows have "id" == 2
<? echo amount of rows where id == 3?> rows have "id" == 3
<? echo amount of rows where id == 4?> rows have "id" == 4
<? echo amount of rows where id == 5?> rows have "id" == 5

and so on ...

can anyone help me out with this?

jatar_k

12:00 am on Dec 27, 2002 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



try this
[mysql.com...]