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")))
echo ("$author - $numarticles");
But that doesnt work
I want it to count all the articles posted by each author
Thanks in advance
First do one query.
Select DISTINCT Author
Then while looping through the results of that query, do a series of queries that ask for your count where author = $author.