A have a table called articles, it contains a name field and an author field.
I need a script to go through and find all the AUTHOR fields that are the same and add them up.
So if in my table there are 2 submissions by john, 3 by mark, and 7 by tom, I need a page to post
2
3
7
I need to achieve this with a loop as well.
is this at all close to what I need to do?I get no errors, just a blank screen.
mysql_connect(localhost,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");
$query = "SELECT author, COUNT(*) as $numArticles FROM articles GROUP BY author ORDER BY ASC";
$result=mysql_query($query);
mysql_close();
$i=0;
while ($i < $result) {
echo "$result";
++$i;
}