Hello.. I have this problem, and just can't figure it out..
I have some fields in my table.
field1 - field2
sep - car
inc - bike
dghd - plane
wej2 - car
arg - car
bla - plane
jhg - bike
What I need is: a query that will give all different entries of field 2, but also counts the number of dublicate field
output would be something like:
car - 3
bike - 2
plane - 2
I've already tried with distinct en count(*), and came to this query:
SELECT distinct field2, count(*) FROM tablename GROUP by field2
This works allright in a mySQL client, but I have no idea to output it with PHP..
Anybody?
Thanx in advance.
Trackz