Okay...newbie question here.
Let's say I have 15 rows, in which 4 are "apple" and 6 are "pear" and 5 are "grape" in random order.
I wish to display a total of number of rows for each fruit to the user:
(i.e. apple=4 pear=5 and so on)
so I think I should
select the data
count the rows
do a while and print out mysql_fetch_array vars
$fruit = $row["fruit_stored_in_column"];
//HERE"S WHERE I'M CONFUSED
should I then create another while and select distinct (Or group by) for the $fruit and count (mysql_num_rows) per iteration?
It seems as though if I had a 10000 rows this could cause some issues ( I will paginate obviously).