I'm trying to count different columns in a single table and store them as variables in PHP, I don't think I should be doing it this way I don't think:
$dog_count = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM animals WHERE animal='dog'"));
$cat_count = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM animals WHERE animal='cat'"));
$parrot_count...
I'm thinking there is probably a better way to count statistics. Any advice?
Thanks :)