I read 3 tutorials and coulnt find this anywhere

How would I turn this SQL command into PHP?

SELECT Author, COUNT(*) AS NumArticles FROM Count GROUP BY Author



I think it is something like
while (mysql_fetch_array(mysql_query("SELECT Author, COUNT(*) AS NumArticles FROM Count GROUP BY Author")))
{
$author=$row["Author"];
$numarticles=$row["NumArticles"];
echo ("$author - $numarticles");
}

But that doesnt work
I want it to count all the articles posted by each author

Thanks in advance