Parašė Enzo· 2008 Bir. 25 12:06:05
#4
vo
openside('Top naujienų rašytojai');
$result = dbquery("SELECT user_name, user_id, count(user_id) AS post_count
FROM ".$db_prefix."news
INNER JOIN ".$db_prefix."users
ON news_name=user_id
GROUP BY user_name
ORDER BY post_count
DESC LIMIT 0,5
");
echo "<table width='100%' cellpadding='0' cellspacing='1' border='0'>";
if (dbrows($result)!=0) {
while ($data=dbarray($result)) {
echo "<tr>
<td class='small' align='left'><a href='".BASEDIR."profile.php?lookup=".$data['user_id']."'>
".$data['user_name']."</a></td>
<td class='small2' align='right'>".$data['post_count']."</td>
</tr>";
}
}
echo "</table>";
closeside();
Redagavo Enzo· 2008 Bir. 25 12:06:28