Hi all,
I have a table called 'archives' and Im trying to make a top uploaders script (people who have the most files in the table)
Im encountering alot of problems, printing double author names, and not displaying the top person first etc...
I only have 4 entrys in there right now, but when I reopen my new site it will jump up to about 250+ (my currently plain html site)
Top Uploaders
Bekar [1 file(s)]
codemastr [2 file(s)]
codemastr [2 file(s)]
ian [1 file(s)]
Is what it looks like, id like it to list the person with the most first, and not more then 1 time.
The archives table has a field called 'author' so I need to some how scan it the 'archives' table and figure out how many entrys there are for every author, and show the top10 in order from most to least.. I think im going about it all wrong:
<?
mysql_connect($scriptaz->server, $scriptaz->db_user, $scriptaz->db_pass);
mysql_select_db($scriptaz->database);
$query = mysql_query("SELECT * from archives order by author LIMIT 0,10");
while ($upload = mysql_fetch_array($query)) {
$uploads = mysql_num_rows(mysql_query("SELECT * from archives WHERE author='$upload[author]'"));
echo "<table width='100%' cellpadding='2' cellspacing='0 border='0' class='noborder'>";
echo "<tr>";
echo "<td align='left'><a href='profile.php?user=$upload[author]'>$upload[author]</a></td>";
echo "<td align='right'><b class='color'>[</b>$uploads file(s)<b class='color'>]</b></td>";
echo "</tr>";
echo "</table>";
}
?>
Any help would be appreciated.