hey guys how are you, I want to create a function ( or more than function ) to show most uploaded users in the site, so I've created simpple code to test this and its worked
<?php
$sql = "SELECT username FROM users";
$run = mysql_query($sql);
if (mysql_num_rows($run) > 0 ) {
while ($data = mysql_fetch_assoc($run)) {
$sql2 = "SELECT addedby FROM files WHERE addedby = '".$data['username']."' ";
$run2 = mysql_query($sql2);
echo $data['username']." uploaded : ". mysql_num_rows($run2)." files";
echo "<br/>";
}
}
?>
and the output was somthing like this
user1 uploaded : 5 files
user2 uploaded : 50 files
and so on .....
I need to minimize this huge sql since my site contain more than 3000 users so I need to show only most 20 users that have uploaded on site.