February 20th, 2000, 12:48 PM
I am working on a little project, I need to make some lookups in a MySQL table.
ID name type
1 John a
2 Martin a
3 Winston c
4 Mark b
5 Bill b
I then need to make a list of which types there are. EG:
And I also need to make a count of how many of each type there are EG:
I am using PHP3 to interface the MySQL db, how can I do this?
February 21st, 2000, 09:14 AM
select distinct(type) from table_name;
select type, count(type) from table_name group by type;