Ok, here's my problem. It relates to a previous solution I got from here but I will write it out again.
Ok say I have one table of animals ... say it's called ANIMALS
ID/Common Name/Species/Category/Etc.
Now I have another table of inventory of these animals in another table .... say it's called ANIMALINVENTORY
ID/AnimalID(filled with ANIMAL.id's)/CageLocation/SeenVet/CheckedInBy/Etc.
Now what I want to do is construct a table ordered in the following manner where all the animals listed were CHECKED IN BY say 'jtown' or any other person.
So say ANIMAL INVENTORY looked like this:
ID | AnimalID | CheckedInBy
1 | 10 | jtown
2 | 10 | charlie
3 | 10 | lisa
4 | 3 | jtown
5 | 10 | ron
6 | 18 | lala
7 | 3 | ron
8 | 99 | whatever
9 | 18 | jtown
10 | 77 | whatever
11 | 55 | whatever
Now I want the outut table to look like this ....
Animal Name | Animal ID | Number of Animals (In ANIMAL INVENTORY)
Dog | 10 | 4
Cat | 3 | 2
Lizard | 18 | 2
Now, this wouldn't be so difficult to do if the CheckedInBy was all 'jtown', but it's not. I hope that makes sense.
My old post is here .... http://www.phpbuilder.com/board/showthread.php?s=&threadid=10228035