Do you have a question? Post it now! No Registration Necessary. Now with pictures!
January 6, 2005, 10:53 am
rate this thread
getting this to work:
My query is the following:
$result = mysql_query("SELECT s.id, s.name, COUNT(a.id) AS
'number_of_animals' FROM species s LEFT JOIN animals a ON
a.species_id=s.id GROUP BY s.name ORDER BY s.name ASC");
1st question: how do i display/get the number_of_animals,
2nd question: what does GROUP BY do?
3rd question: What happens if in both tables i have an id, so s.id &
How can i display both in the result, since echo
Hope it's all clear, and thanks in advance!!
Greetings and have a wonderful day!