HI,
Here is what i did... but there is some problem with the URL link T_T ..the : $scripturl
here is my code
<table>
<?
conn_db();
$topic_view_result = mysql_query("
SELECT m.subject,
t.ID_TOPIC,
t.ID_BOARD, t.numViews
FROM yabbse_topics AS t,yabbse_messages AS m, yabbse_messages AS mes , yabbse_boards AS b, yabbse_categories AS c
WHERE
m.ID_MSG=t.ID_FIRST_MSG
AND
mes.ID_MSG=t.ID_LAST_MSG
AND
t.ID_BOARD=b.ID_BOARD
AND
c.ID_CAT=b.ID_CAT
ORDER BY t.numViews DESC limit 10") ;
// it is 'ORDER BY t.numReplies DESC")' for by replies...
// 'limit 10' is for 10 record shown
while ($row_topic_view = mysql_fetch_array($topic_view_result))
{
echo '
<tr>
<td><font size="2"><a href="' .
$scripturl . '?board=' . $row_topic_view['ID_BOARD'] . ';action=display;threadid=' . $row_topic_view['ID_TOPIC'] . ';start=0">' . $row_topic_view['subject'] . '</a></font></td>
<td align="right"><font size="2">' . $row_topic_view['numViews'] . '</font></td>
</tr>';
}
function conn_db()
{
mysql_connect ("localhost","root","");
mysql_select_db("yabbse");
return;
}
?>
</table>